Skip to content

Commit 457e054

Browse files
author
Komal Yadav
committed
Add exit gate
updated updated updated updated updated updated updated updated updated updated updated updated updated updated
1 parent 15aeb92 commit 457e054

3 files changed

Lines changed: 96 additions & 62 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright © 2022 Cask Data, Inc.
1+
# Copyright © 2025 Cask Data, Inc.
22
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
33
# use this file except in compliance with the License. You may obtain a copy of
44
# the License at
@@ -25,16 +25,6 @@ jobs:
2525

2626
steps:
2727

28-
- name: Get Secrets from GCP Secret Manager
29-
id: 'secrets'
30-
uses: 'google-github-actions/get-secretmanager-secrets@v0'
31-
with:
32-
secrets: |-
33-
CDAP_OSSRH_USERNAME:cdapio-github-builds/CDAP_OSSRH_USERNAME
34-
CDAP_OSSRH_PASSWORD:cdapio-github-builds/CDAP_OSSRH_PASSWORD
35-
CDAP_GPG_PASSPHRASE:cdapio-github-builds/CDAP_GPG_PASSPHRASE
36-
CDAP_GPG_PRIVATE_KEY:cdapio-github-builds/CDAP_GPG_PRIVATE_KEY
37-
3828
- name: Checkout Repository
3929
uses: actions/checkout@v4
4030
with:
@@ -49,23 +39,11 @@ jobs:
4939
restore-keys: |
5040
${{ runner.os }}-maven-cdap-e2e-framework
5141
52-
- name: Import GPG key
53-
run: |
54-
echo "$GPG_PRIVATE_KEY" > private.key
55-
gpg --import --batch private.key
56-
env:
57-
GPG_PRIVATE_KEY: ${{ steps.secrets.outputs.CDAP_GPG_PRIVATE_KEY }}
58-
59-
- name: Set up GPG conf
42+
- name: Submit Build to GCB
43+
id: gcb
44+
working-directory: cdap-e2e-tests
6045
run: |
61-
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
62-
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
46+
gcloud builds submit . \
47+
--config=cloudbuild.yaml \
48+
--project='cdapio-github-builds' \
6349
64-
- name: Build and Deploy
65-
working-directory: e2e
66-
run: mvn -B -V -DskipTests clean deploy -P release -Dgpg.passphrase=$CDAP_GPG_PASSPHRASE -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=30
67-
env:
68-
CDAP_OSSRH_USERNAME: ${{ steps.secrets.outputs.CDAP_OSSRH_USERNAME }}
69-
CDAP_OSSRH_PASSWORD: ${{ steps.secrets.outputs.CDAP_OSSRH_PASSWORD }}
70-
CDAP_GPG_PASSPHRASE: ${{ steps.secrets.outputs.CDAP_GPG_PASSPHRASE }}
71-
MAVEN_OPTS: '-Xmx3200m'

cloudbuild.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Copyright © 2025 Cask Data, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
3+
# use this file except in compliance with the License. You may obtain a copy of
4+
# the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
9+
# License for the specific language governing permissions and limitations under
10+
# the License.
11+
12+
steps:
13+
- name: 'gcr.io/cloud-builders/mvn:3.8-jdk-8'
14+
id: maven-package
15+
entrypoint: 'mvn'
16+
args:
17+
- -B
18+
- -U
19+
- clean
20+
- package
21+
- -DskipTests
22+
23+
- name: 'gcr.io/cloud-builders/mvn:3.8-jdk-8'
24+
id: deploy-to-artifact-registry
25+
entrypoint: 'mvn'
26+
args:
27+
- 'deploy'
28+
- '-DskipTests'
29+
- '-Dmaven.wagon.http.google.EffectiveVersion=1.0.1'
30+
waitFor: ['maven-package']
31+
32+
- name: 'bash'
33+
id: create-exit-gate-manifest
34+
entrypoint: 'bash'
35+
args:
36+
- '-c'
37+
- |
38+
set -e
39+
MANIFEST_FILE="/workspace/exit_gate_manifest.textproto"
40+
echo '# -*- protobuffer -*-' > "$${MANIFEST_FILE}"
41+
echo '# proto-file: security/opensource/exit_gate_v1/onboarded/proto/publishing_manifest.proto' >> "$${MANIFEST_FILE}"
42+
echo '# proto-message: PublishingManifest' >> "$${MANIFEST_FILE}"
43+
echo '' >> "$${MANIFEST_FILE}"
44+
echo 'publish_all: true' >> "$${MANIFEST_FILE}"
45+
echo "Created manifest file: $${MANIFEST_FILE}"
46+
waitFor: ['deploy-to-artifact-registry']
47+
48+
- name: 'gcr.io/cloud-builders/gsutil'
49+
id: upload-exit-gate-manifest
50+
entrypoint: 'bash'
51+
args:
52+
- '-c'
53+
- |
54+
set -e
55+
GCS_MANIFEST_DIR="gs://oss-exit-gate-prod-projects-bucket/cloud-data-fusion/mavencentral/manifests/"
56+
MANIFEST_FILE="/workspace/exit_gate_manifest.textproto"
57+
# Use a timestamp to create a unique manifest filename for each release
58+
MANIFEST_FILENAME="release_$(date -u +%Y%m%d%H%M%S).textproto"
59+
60+
echo "Uploading manifest to $${GCS_MANIFEST_DIR}$${MANIFEST_FILENAME}"
61+
gsutil cp "$${MANIFEST_FILE}" "$${GCS_MANIFEST_DIR}$${MANIFEST_FILENAME}"
62+
echo "Manifest uploaded successfully. OSS Exit Gate process should now be triggered."
63+
waitFor: ['create-exit-gate-manifest']
64+
65+
options:
66+
requestedVerifyOption: VERIFIED
67+
machineType: 'E2_HIGHCPU_32'

pom.xml

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,43 @@ the License.-->
4747
<tag>HEAD</tag>
4848
</scm>
4949

50+
<distributionManagement>
51+
<snapshotRepository>
52+
<id>artifact-registry</id>
53+
<url>artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
54+
</snapshotRepository>
55+
<repository>
56+
<id>artifact-registry</id>
57+
<url>artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
58+
</repository>
59+
</distributionManagement>
60+
5061
<repositories>
5162
<repository>
52-
<id>sonatype-snapshots</id>
53-
<url>https://central.sonatype.com/repository/maven-snapshots</url>
63+
<id>artifact-registry</id>
64+
<url>artifactregistry:us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
5465
<releases>
55-
<enabled>false</enabled>
66+
<enabled>true</enabled>
5667
</releases>
5768
<snapshots>
5869
<enabled>true</enabled>
5970
</snapshots>
6071
</repository>
6172
</repositories>
6273

63-
6474
<properties>
6575
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6676
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
6777
</properties>
78+
6879
<build>
80+
<extensions>
81+
<extension>
82+
<groupId>com.google.cloud.artifactregistry</groupId>
83+
<artifactId>artifactregistry-maven-wagon</artifactId>
84+
<version>2.2.5</version>
85+
</extension>
86+
</extensions>
6987
<plugins>
7088
<plugin>
7189
<groupId>org.apache.maven.plugins</groupId>
@@ -216,35 +234,6 @@ the License.-->
216234
</execution>
217235
</executions>
218236
</plugin>
219-
220-
<plugin>
221-
<groupId>org.apache.maven.plugins</groupId>
222-
<artifactId>maven-gpg-plugin</artifactId>
223-
<version>1.5</version>
224-
<configuration>
225-
<passphrase>${gpg.passphrase}</passphrase>
226-
<useAgent>${gpg.useagent}</useAgent>
227-
</configuration>
228-
<executions>
229-
<execution>
230-
<goals>
231-
<goal>sign</goal>
232-
</goals>
233-
</execution>
234-
</executions>
235-
</plugin>
236-
237-
<plugin>
238-
<groupId>org.sonatype.central</groupId>
239-
<artifactId>central-publishing-maven-plugin</artifactId>
240-
<version>0.8.0</version>
241-
<extensions>true</extensions>
242-
<configuration>
243-
<publishingServerId>sonatype.release</publishingServerId>
244-
<autoPublish>false</autoPublish>
245-
<ignorePublishedComponents>true</ignorePublishedComponents>
246-
</configuration>
247-
</plugin>
248237
</plugins>
249238
</build>
250239
</profile>

0 commit comments

Comments
 (0)