44
55set -e
66
7+ # Flag to disable commit mapping functionality
8+ # Set to "true" to disable commit mapping operations
9+ DISABLE_COMMIT_MAPPING=" ${DISABLE_COMMIT_MAPPING:- true} "
10+
711# Function to execute curl commands with retry and error handling
812execute_curl_with_retry () {
913 local url=" $1 "
@@ -91,11 +95,14 @@ generate_checksums() {
9195publish_to_maven () {
9296 echo " Publishing artifacts to Maven repository..."
9397
94- # Navigate to build directory and copy artifacts
98+ # Make a temp directory for publish-snapshot.sh
99+ mkdir -p build/resources/publish/
100+ cp build/publish/publish-snapshot.sh build/resources/publish/
101+ chmod +x build/resources/publish/publish-snapshot.sh
102+
103+ # Continue with the original flow
95104 cd build/resources/publish/
96105 cp -a $HOME /.m2/repository/* ./
97-
98- # Run the publish script
99106 ./publish-snapshot.sh ./
100107
101108 echo " Maven publishing completed"
@@ -108,6 +115,11 @@ update_version_metadata() {
108115 local commit_id=" $3 "
109116 local snapshot_repo_url=" ${4:- $SNAPSHOT_REPO_URL } "
110117
118+ if [ " $DISABLE_COMMIT_MAPPING " = " true" ]; then
119+ echo " Skipping version metadata update (commit mapping disabled)"
120+ return 0
121+ fi
122+
111123 echo " Updating version metadata for ${artifact_id} version ${version} with commit ID ${commit_id} "
112124
113125 TEMP_DIR=$( mktemp -d)
@@ -201,6 +213,11 @@ update_commit_mapping() {
201213 local commit_map_filename=" ${5:- $COMMIT_MAP_FILENAME } "
202214 local snapshot_repo_url=" ${6:- $SNAPSHOT_REPO_URL } "
203215
216+ if [ " $DISABLE_COMMIT_MAPPING " = " true" ]; then
217+ echo " Skipping commit-version mapping update (commit mapping disabled)"
218+ return 0
219+ fi
220+
204221 echo " Updating commit-version mapping for ${artifact_id} "
205222
206223 # Create temp directory for work
0 commit comments