Skip to content

Commit 809466b

Browse files
author
Komal Yadav
committed
updated
1 parent b4c35ba commit 809466b

File tree

3 files changed

+96
-101
lines changed

3 files changed

+96
-101
lines changed

.github/workflows/cloudbuild.yaml

Lines changed: 71 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -10,97 +10,93 @@
1010
# the License.
1111

1212
steps:
13-
- name: 'gcr.io/cloud-builders/gcloud'
14-
id: setup-gpg
15-
entrypoint: 'bash'
16-
secretEnv: ['GPG_KEY']
17-
args:
18-
- '-c'
19-
- |
20-
set -e
21-
# Set a persistent GPG home in /workspace so other steps can see it
22-
export GNUPGHOME=/workspace/.gnupg
23-
mkdir -p $$GNUPGHOME
24-
chmod 700 $$GNUPGHOME
25-
26-
# Configure loopback mode for non-interactive signing
27-
echo "pinentry-mode loopback" >> $$GNUPGHOME/gpg.conf
28-
echo "allow-loopback-pinentry" >> $$GNUPGHOME/gpg-agent.conf
29-
30-
# Import the key directly from the secret environment variable
31-
echo "$$GPG_KEY" | gpg --batch --import
32-
echo "GPG key imported into $$GNUPGHOME."
13+
# - name: 'gcr.io/cloud-builders/gcloud'
14+
# id: setup-gpg
15+
# entrypoint: 'bash'
16+
## secretEnv: ['GPG_KEY']
17+
# args:
18+
# - '-c'
19+
# - |
20+
# set -e
21+
# # Set a persistent GPG home in /workspace so other steps can see it
22+
# export GNUPGHOME=/workspace/.gnupg
23+
# mkdir -p $$GNUPGHOME
24+
# chmod 700 $$GNUPGHOME
25+
#
26+
# # Configure loopback mode for non-interactive signing
27+
# echo "pinentry-mode loopback" >> $$GNUPGHOME/gpg.conf
28+
# echo "allow-loopback-pinentry" >> $$GNUPGHOME/gpg-agent.conf
29+
#
30+
# # Import the key directly from the secret environment variable
31+
# echo "$$GPG_KEY" | gpg --batch --import
32+
# echo "GPG key imported into $$GNUPGHOME."
3333

3434
- name: 'gcr.io/cloud-builders/mvn:3.8-jdk-8'
3535
id: maven-package
36-
entrypoint: 'bash'
37-
secretEnv: [ 'GPG_PASSPHRASE' ]
36+
entrypoint: 'mvn' # Directly use mvn as entrypoint
3837
args:
39-
- '-c'
40-
- |
41-
set -e
42-
export GNUPGHOME=/workspace/.gnupg
43-
44-
mvn deploy -B -V -DskipTests \
45-
- deploy
46-
- -P
47-
- common-artifacts, version-release
48-
- Dgpg.passphrase="$${CDAP_GPG_PASSPHRASE}"
49-
- -Dmaven.wagon.http.retryHandler.count=5
50-
- -Dmaven.wagon.httpconnectionManager.ttlSeconds=30
38+
- 'deploy'
39+
- '-B'
40+
- '-V'
41+
- '-DskipTests'
42+
- '-Pcommon-artifacts,version-release'
43+
- '-DaltDeploymentRepository=local::default::file:///workspace/target'
44+
- '-Dmaven.wagon.http.retryHandler.count=5'
45+
- '-Dmaven.wagon.httpconnectionManager.ttlSeconds=30'
46+
# env:
47+
# - 'GNUPGHOME=/workspace/.gnupg'
48+
# secretEnv: [ 'GPG_PASSPHRASE' ]
5149

52-
- name: 'bash'
53-
id: create-exit-gate-manifest
54-
entrypoint: 'bash'
55-
args:
56-
- '-c'
57-
- |
58-
# Correctly access the output variable from determine-deploy using $$_STEP_ID_KEY
59-
if [[ "$$_DETERMINE_DEPLOY_IS_SNAPSHOT" == "false" ]]; then
60-
set -e
61-
MANIFEST_FILE="/workspace/exit_gate_manifest.textproto"
62-
echo '# -*- protobuffer -*-' > "$${MANIFEST_FILE}"
63-
echo '# proto-file: security/opensource/exit_gate_v1/onboarded/proto/publishing_manifest.proto' >> "$${MANIFEST_FILE}"
64-
echo '# proto-message: PublishingManifest' >> "$${MANIFEST_FILE}"
65-
echo '' >> "$${MANIFEST_FILE}"
66-
echo 'publish_all: true' >> "$${MANIFEST_FILE}"
67-
echo "Created manifest file: $${MANIFEST_FILE}"
68-
waitFor: ['maven-package']
6950

70-
- name: 'gcr.io/cloud-builders/gsutil'
71-
id: upload-exit-gate-manifest
72-
entrypoint: 'bash'
73-
args:
74-
- '-c'
75-
- |
76-
set -e
77-
GCS_MANIFEST_DIR="gs://oss-exit-gate-prod-projects-bucket/cloud-data-fusion/mavencentral/manifests/"
78-
MANIFEST_FILE="/workspace/exit_gate_manifest.textproto"
79-
MANIFEST_FILENAME="release_$$(date -u +%Y%m%d%H%M%S).textproto"
80-
echo "Uploading manifest to $${GCS_MANIFEST_DIR}$${MANIFEST_FILENAME}"
81-
gsutil cp "$${MANIFEST_FILE}" "$${GCS_MANIFEST_DIR}$${MANIFEST_FILENAME}"
82-
echo "Manifest uploaded successfully. OSS Exit Gate process should now be triggered."
83-
waitFor: ['create-exit-gate-manifest']
51+
# - name: 'bash'
52+
# id: create-exit-gate-manifest
53+
# entrypoint: 'bash'
54+
# args:
55+
# - '-c'
56+
# - |
57+
# set -e
58+
# MANIFEST_FILE="/workspace/exit_gate_manifest.textproto"
59+
# echo '# -*- protobuffer -*-' > "$${MANIFEST_FILE}"
60+
# echo '# proto-file: security/opensource/exit_gate_v1/onboarded/proto/publishing_manifest.proto' >> "$${MANIFEST_FILE}"
61+
# echo '# proto-message: PublishingManifest' >> "$${MANIFEST_FILE}"
62+
# echo '' >> "$${MANIFEST_FILE}"
63+
# echo 'publish_all: true' >> "$${MANIFEST_FILE}"
64+
# echo "Created manifest file: $${MANIFEST_FILE}"
65+
# waitFor: ['maven-package']
66+
#
67+
# - name: 'gcr.io/cloud-builders/gsutil'
68+
# id: upload-exit-gate-manifest
69+
# entrypoint: 'bash'
70+
# args:
71+
# - '-c'
72+
# - |
73+
# set -e
74+
# GCS_MANIFEST_DIR="gs://oss-exit-gate-prod-projects-bucket/cloud-data-fusion/mavencentral/manifests/"
75+
# MANIFEST_FILE="/workspace/exit_gate_manifest.textproto"
76+
# MANIFEST_FILENAME="release_$$(date -u +%Y%m%d%H%M%S).textproto"
77+
# echo "Uploading manifest to $${GCS_MANIFEST_DIR}$${MANIFEST_FILENAME}"
78+
# gsutil cp "$${MANIFEST_FILE}" "$${GCS_MANIFEST_DIR}$${MANIFEST_FILENAME}"
79+
# echo "Manifest uploaded successfully. OSS Exit Gate process should now be triggered."
80+
# waitFor: ['create-exit-gate-manifest']
8481

8582

8683
substitutions:
8784
_VERSION: '0.25.0-SNAPSHOT'
8885

89-
#
9086
#artifacts:
9187
# mavenArtifacts:
92-
# - repository: 'https://us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral'
88+
# - repository: 'https://us-east1-maven.pkg.dev/komalyd-dev/my-test-maven-repo'
9389
# deployFolder: '/workspace/target/'
9490
# groupId: 'io.cdap.plugin'
9591
# artifactId: 'google-cloud'
9692
# version: '${_VERSION}'
97-
98-
options:
99-
requestedVerifyOption: VERIFIED
100-
machineType: 'E2_HIGHCPU_32'
93+
#
94+
#options:
95+
# requestedVerifyOption: VERIFIED
96+
# machineType: 'E2_HIGHCPU_32'
10197

10298

103-
availableSecrets:
104-
secretManager:
105-
- versionName: projects/cdapio-github-builds/secrets/CDAP_GPG_PASSPHRASE/versions/latest
106-
env: 'CDAP_GPG_PASSPHRASE'
99+
#availableSecrets:
100+
# secretManager:
101+
# - versionName: projects/cdapio-github-builds/secrets/CDAP_GPG_PASSPHRASE/versions/latest
102+
# env: 'CDAP_GPG_PASSPHRASE'

.github/workflows/tag-release.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,16 @@ jobs:
6363
id: get_version
6464
run: echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
6565

66-
- name: Publish SNAPSHOT to Maven Central
67-
if: ${{ endsWith(steps.get_version.outputs.VERSION, '-SNAPSHOT') }}
68-
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
69-
env:
70-
CDAP_OSSRH_USERNAME: ${{ steps.secrets.outputs.CDAP_OSSRH_USERNAME }}
71-
CDAP_OSSRH_PASSWORD: ${{ steps.secrets.outputs.CDAP_OSSRH_PASSWORD }}
72-
CDAP_GPG_PASSPHRASE: ${{ steps.secrets.outputs.CDAP_GPG_PASSPHRASE }}
73-
MAVEN_OPTS: '-Xmx3200m'
66+
# - name: Publish SNAPSHOT to Maven Central
67+
# if: ${{ endsWith(steps.get_version.outputs.VERSION, '-SNAPSHOT') }}
68+
# 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
69+
# env:
70+
# CDAP_OSSRH_USERNAME: ${{ steps.secrets.outputs.CDAP_OSSRH_USERNAME }}
71+
# CDAP_OSSRH_PASSWORD: ${{ steps.secrets.outputs.CDAP_OSSRH_PASSWORD }}
72+
# CDAP_GPG_PASSPHRASE: ${{ steps.secrets.outputs.CDAP_GPG_PASSPHRASE }}
73+
# MAVEN_OPTS: '-Xmx3200m'
7474

7575
- name: Submit Build to GCB
76-
if: ${{ ! endsWith(steps.get_version.outputs.VERSION, '-SNAPSHOT') }}
7776
id: gcb
7877
run: |
7978
gcloud builds submit . \

pom.xml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,22 +1136,22 @@
11361136
</executions>
11371137
</plugin>
11381138

1139-
<plugin>
1140-
<groupId>org.apache.maven.plugins</groupId>
1141-
<artifactId>maven-gpg-plugin</artifactId>
1142-
<version>1.5</version>
1143-
<configuration>
1144-
<passphrase>${gpg.passphrase}</passphrase>
1145-
<useAgent>${gpg.useagent}</useAgent>
1146-
</configuration>
1147-
<executions>
1148-
<execution>
1149-
<goals>
1150-
<goal>sign</goal>
1151-
</goals>
1152-
</execution>
1153-
</executions>
1154-
</plugin>
1139+
<!-- <plugin>-->
1140+
<!-- <groupId>org.apache.maven.plugins</groupId>-->
1141+
<!-- <artifactId>maven-gpg-plugin</artifactId>-->
1142+
<!-- <version>1.5</version>-->
1143+
<!-- <configuration>-->
1144+
<!-- <passphrase>${gpg.passphrase}</passphrase>-->
1145+
<!-- <useAgent>${gpg.useagent}</useAgent>-->
1146+
<!-- </configuration>-->
1147+
<!-- <executions>-->
1148+
<!-- <execution>-->
1149+
<!-- <goals>-->
1150+
<!-- <goal>sign</goal>-->
1151+
<!-- </goals>-->
1152+
<!-- </execution>-->
1153+
<!-- </executions>-->
1154+
<!-- </plugin>-->
11551155
</plugins>
11561156
</build>
11571157
</profile>
@@ -1161,7 +1161,7 @@
11611161
<distributionManagement>
11621162
<repository>
11631163
<id>artifact-registry</id>
1164-
<url>artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/cloud-data-fusion--mavencentral</url>
1164+
<url>artifactregistry://us-east1-maven.pkg.dev/komalyd-dev/my-test-maven-repo</url>
11651165
</repository>
11661166
</distributionManagement>
11671167
</profile>

0 commit comments

Comments
 (0)