Skip to content

Commit b92f2e3

Browse files
author
Komal Yadav
committed
Add exit gate
updated updated updatex updated updated updated updated updated updated updated updated
1 parent 63524d1 commit b92f2e3

File tree

3 files changed

+96
-61
lines changed

3 files changed

+96
-61
lines changed

.github/workflows/tag-release.yml

Lines changed: 9 additions & 30 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
@@ -21,16 +21,6 @@ jobs:
2121
if: ${{ github.ref_type == 'tag' }}
2222
steps:
2323

24-
- name: Get Secrets from GCP Secret Manager
25-
id: 'secrets'
26-
uses: 'google-github-actions/get-secretmanager-secrets@v0'
27-
with:
28-
secrets: |-
29-
CDAP_OSSRH_USERNAME:cdapio-github-builds/CDAP_OSSRH_USERNAME
30-
CDAP_OSSRH_PASSWORD:cdapio-github-builds/CDAP_OSSRH_PASSWORD
31-
CDAP_GPG_PASSPHRASE:cdapio-github-builds/CDAP_GPG_PASSPHRASE
32-
CDAP_GPG_PRIVATE_KEY:cdapio-github-builds/CDAP_GPG_PRIVATE_KEY
33-
3424
- name: Checkout Repository
3525
uses: actions/checkout@v4
3626
with:
@@ -44,25 +34,14 @@ jobs:
4434
restore-keys: |
4535
${{ runner.os }}-maven-${{ github.workflow }}
4636
47-
- name: Set up GPG conf
48-
run: |
49-
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
50-
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
51-
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-
5937
- name: Run tests
6038
run: mvn clean test -fae -T 2 -B -V -DcloudBuild -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=30
6139

62-
- name: Publish to Maven Central
63-
run: mvn clean -B -V -DskipTests deploy -P release -Dgpg.passphrase=$CDAP_GPG_PASSPHRASE -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=30
64-
env:
65-
CDAP_OSSRH_USERNAME: ${{ steps.secrets.outputs.CDAP_OSSRH_USERNAME }}
66-
CDAP_OSSRH_PASSWORD: ${{ steps.secrets.outputs.CDAP_OSSRH_PASSWORD }}
67-
CDAP_GPG_PASSPHRASE: ${{ steps.secrets.outputs.CDAP_GPG_PASSPHRASE }}
68-
MAVEN_OPTS: '-Xmx3200m'
40+
- name: Submit Build to GCB
41+
id: gcb
42+
working-directory: google-cloud
43+
run: |
44+
gcloud builds submit . \
45+
--config=cloudbuild-release.yaml \
46+
--project='cdapio-github-builds' \
47+

cloudbuild-release.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+
- '-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+
# 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: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@
9191
<testSourceLocation>${project.basedir}/src/test/java/</testSourceLocation>
9292
</properties>
9393

94+
<distributionManagement>
95+
<snapshotRepository>
96+
<id>artifact-registry</id>
97+
<url>artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
98+
</snapshotRepository>
99+
<repository>
100+
<id>artifact-registry</id>
101+
<url>artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
102+
</repository>
103+
</distributionManagement>
104+
94105
<dependencyManagement>
95106
<dependencies>
96107
<dependency>
@@ -108,10 +119,10 @@
108119

109120
<repositories>
110121
<repository>
111-
<id>sonatype-snapshots</id>
112-
<url>https://central.sonatype.com/repository/maven-snapshots</url>
122+
<id>artifact-registry</id>
123+
<url>artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
113124
<releases>
114-
<enabled>false</enabled>
125+
<enabled>true</enabled>
115126
</releases>
116127
<snapshots>
117128
<enabled>true</enabled>
@@ -904,6 +915,13 @@
904915
</dependencies>
905916

906917
<build>
918+
<extensions>
919+
<extension>
920+
<groupId>com.google.cloud.artifactregistry</groupId>
921+
<artifactId>artifactregistry-maven-wagon</artifactId>
922+
<version>2.2.5</version>
923+
</extension>
924+
</extensions>
907925
<testSourceDirectory>${testSourceLocation}</testSourceDirectory>
908926
<plugins>
909927
<plugin>
@@ -1128,34 +1146,6 @@
11281146
</execution>
11291147
</executions>
11301148
</plugin>
1131-
1132-
<plugin>
1133-
<groupId>org.apache.maven.plugins</groupId>
1134-
<artifactId>maven-gpg-plugin</artifactId>
1135-
<version>1.5</version>
1136-
<configuration>
1137-
<passphrase>${gpg.passphrase}</passphrase>
1138-
<useAgent>${gpg.useagent}</useAgent>
1139-
</configuration>
1140-
<executions>
1141-
<execution>
1142-
<goals>
1143-
<goal>sign</goal>
1144-
</goals>
1145-
</execution>
1146-
</executions>
1147-
</plugin>
1148-
<plugin>
1149-
<groupId>org.sonatype.central</groupId>
1150-
<artifactId>central-publishing-maven-plugin</artifactId>
1151-
<version>0.8.0</version>
1152-
<extensions>true</extensions>
1153-
<configuration>
1154-
<publishingServerId>sonatype.release</publishingServerId>
1155-
<autoPublish>false</autoPublish>
1156-
<ignorePublishedComponents>true</ignorePublishedComponents>
1157-
</configuration>
1158-
</plugin>
11591149
</plugins>
11601150
</build>
11611151
</profile>

0 commit comments

Comments
 (0)