Skip to content

Commit 96d9a09

Browse files
author
Komal Yadav
committed
Add exit gate
updated updated updated updated updated updated updated updated
1 parent 3c2ce71 commit 96d9a09

File tree

3 files changed

+107
-63
lines changed

3 files changed

+107
-63
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 10 additions & 27 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,15 +25,6 @@ jobs:
2525
branch: [ develop ]
2626

2727
steps:
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
3728

3829
- name: Recursively Checkout Repository
3930
uses: actions/checkout@v3
@@ -50,22 +41,14 @@ jobs:
5041
restore-keys: |
5142
${{ runner.os }}-maven-${{ github.workflow }}
5243
53-
- name: Set up GPG conf
44+
- name: 'Submit Build to Google Cloud Build'
45+
id: gcb
46+
working-directory: netty-http
5447
run: |
55-
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
56-
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
57-
58-
- name: Import GPG key
48+
- name: Submit Build to GCB
49+
id: gcb
50+
working-directory: cdap-e2e-tests
5951
run: |
60-
echo "$GPG_PRIVATE_KEY" > private.key
61-
gpg --import --batch private.key
62-
env:
63-
GPG_PRIVATE_KEY: ${{ steps.secrets.outputs.CDAP_GPG_PRIVATE_KEY }}
64-
65-
- name: Deploy Maven
66-
working-directory: netty
67-
run: mvn -U clean deploy -P release -Dgpg.passphrase=$CDAP_GPG_PASSPHRASE
68-
env:
69-
CDAP_OSSRH_USERNAME: ${{ steps.secrets.outputs.CDAP_OSSRH_USERNAME }}
70-
CDAP_OSSRH_PASSWORD: ${{ steps.secrets.outputs.CDAP_OSSRH_PASSWORD }}
71-
CDAP_GPG_PASSPHRASE: ${{ steps.secrets.outputs.CDAP_GPG_PASSPHRASE }}
52+
gcloud builds submit . \
53+
--config=cloudbuild.yaml \
54+
--project='cdapio-github-builds'

cloudbuild.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
- '-Dmaven.wagon.http.google.EffectiveVersion=1.0.1'
29+
waitFor: ['maven-package']
30+
31+
- name: 'bash'
32+
id: create-exit-gate-manifest
33+
entrypoint: 'bash'
34+
args:
35+
- '-c'
36+
- |
37+
set -e
38+
MANIFEST_FILE="/workspace/exit_gate_manifest.textproto"
39+
echo '# -*- protobuffer -*-' > "$${MANIFEST_FILE}"
40+
echo '# proto-file: security/opensource/exit_gate_v1/onboarded/proto/publishing_manifest.proto' >> "$${MANIFEST_FILE}"
41+
echo '# proto-message: PublishingManifest' >> "$${MANIFEST_FILE}"
42+
echo '' >> "$${MANIFEST_FILE}"
43+
echo 'publish_all = true' >> "$${MANIFEST_FILE}"
44+
echo "Created manifest file: $${MANIFEST_FILE}"
45+
waitFor: ['deploy-to-artifact-registry']
46+
47+
- name: 'gcr.io/cloud-builders/gsutil'
48+
id: upload-exit-gate-manifest
49+
entrypoint: 'bash'
50+
args:
51+
- '-c'
52+
- |
53+
set -e
54+
GCS_MANIFEST_DIR="gs://oss-exit-gate-prod-projects-bucket/cloud-data-fusion/mavencentral/manifests/"
55+
MANIFEST_FILE="/workspace/exit_gate_manifest.textproto"
56+
# Use a timestamp to create a unique manifest filename for each release
57+
MANIFEST_FILENAME="release_$(date -u +%Y%m%d%H%M%S).textproto"
58+
59+
echo "Uploading manifest to $${GCS_MANIFEST_DIR}$${MANIFEST_FILENAME}"
60+
gsutil cp "$${MANIFEST_FILE}" "$${GCS_MANIFEST_DIR}$${MANIFEST_FILENAME}"
61+
echo "Manifest uploaded successfully. OSS Exit Gate process should now be triggered."
62+
waitFor: ['create-exit-gate-manifest']
63+
64+
options:
65+
requestedVerifyOption: VERIFIED
66+
machineType: 'E2_HIGHCPU_32'

pom.xml

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,30 @@
6262
<gson.version>2.2.4</gson.version>
6363
</properties>
6464

65+
<distributionManagement>
66+
<snapshotRepository>
67+
<id>artifact-registry</id>
68+
<url>artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
69+
</snapshotRepository>
70+
<repository>
71+
<id>artifact-registry</id>
72+
<url>artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
73+
</repository>
74+
</distributionManagement>
75+
76+
<repositories>
77+
<repository>
78+
<id>artifact-registry</id>
79+
<url>artifactregistry:us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
80+
<releases>
81+
<enabled>true</enabled>
82+
</releases>
83+
<snapshots>
84+
<enabled>true</enabled>
85+
</snapshots>
86+
</repository>
87+
</repositories>
88+
6589
<dependencies>
6690
<dependency>
6791
<groupId>javax.ws.rs</groupId>
@@ -128,6 +152,13 @@
128152
</dependencies>
129153

130154
<build>
155+
<extensions>
156+
<extension>
157+
<groupId>com.google.cloud.artifactregistry</groupId>
158+
<artifactId>artifactregistry-maven-wagon</artifactId>
159+
<version>2.2.5</version>
160+
</extension>
161+
</extensions>
131162
<plugins>
132163
<!-- Compiler -->
133164
<plugin>
@@ -342,38 +373,6 @@
342373
</execution>
343374
</executions>
344375
</plugin>
345-
346-
<!-- GPG signature -->
347-
<plugin>
348-
<groupId>org.apache.maven.plugins</groupId>
349-
<artifactId>maven-gpg-plugin</artifactId>
350-
<version>1.5</version>
351-
<configuration>
352-
<passphrase>${gpg.passphrase}</passphrase>
353-
<useAgent>${gpg.useagent}</useAgent>
354-
</configuration>
355-
<executions>
356-
<execution>
357-
<goals>
358-
<goal>sign</goal>
359-
</goals>
360-
</execution>
361-
</executions>
362-
</plugin>
363-
364-
<!-- Nexus deploy plugin -->
365-
<plugin>
366-
<groupId>org.sonatype.central</groupId>
367-
<artifactId>central-publishing-maven-plugin</artifactId>
368-
<version>0.8.0</version>
369-
<extensions>true</extensions>
370-
<configuration>
371-
<publishingServerId>sonatype.release</publishingServerId>
372-
<autoPublish>false</autoPublish>
373-
<ignorePublishedComponents>true</ignorePublishedComponents>
374-
</configuration>
375-
</plugin>
376-
377376
</plugins>
378377
</pluginManagement>
379378

@@ -393,10 +392,6 @@
393392
<artifactId>maven-gpg-plugin</artifactId>
394393
<version>1.5</version>
395394
</plugin>
396-
<plugin>
397-
<groupId>org.sonatype.central</groupId>
398-
<artifactId>central-publishing-maven-plugin</artifactId>
399-
</plugin>
400395
</plugins>
401396
</build>
402397
</profile>

0 commit comments

Comments
 (0)