Skip to content

Commit c335935

Browse files
authored
Simplify deployment process in .ci.deploy.sh
Refactor deployment script to combine decryption and Maven execution into a single Docker run command, ensuring OpenSSL is installed as needed.
1 parent 6100c70 commit c335935

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

.ci.deploy.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,8 @@ git config --local user.name "github-actions[bot]"
2222
mkdir -p "${HOME}/.m2"
2323
cp .ci.settings.xml "${HOME}"/.m2/settings.xml
2424

25-
# First run: decrypt secrets using alpine/openssl image
26-
docker run --rm -v "${PWD}":/usr/src/build \
27-
-w /usr/src/build \
28-
-e encrypted_96e73e3cb232_key \
29-
-e encrypted_96e73e3cb232_iv \
30-
-e encrypted_00fae8efff8c_key \
31-
-e encrypted_00fae8efff8c_iv \
32-
--entrypoint "" \
33-
alpine/openssl \
34-
/bin/sh .ci.prepare-ssh-gpg.sh
35-
36-
# Second run: setup keys and execute maven command using the current image
25+
# Execute decryption, setup keys and execute maven command using a single image
26+
# We install openssl in case it's missing in the maven image
3727
docker run --rm -v "${PWD}":/usr/src/build \
3828
-v "${HOME}/.m2":/root/.m2 \
3929
-w /usr/src/build \
@@ -46,7 +36,7 @@ docker run --rm -v "${PWD}":/usr/src/build \
4636
-e GPG_KEY_NAME \
4737
-e GPG_PASSPHRASE \
4838
maven:3.9-eclipse-temurin-"${JDK_VERSION}" \
49-
/bin/bash -c "cd dockerfile-image-update && mvn --quiet --batch-mode deploy -P release scm:tag -Drevision=${NEW_PATCH_VERSION}"
39+
/bin/bash -c "apt-get update && apt-get install -y openssl && source .ci.prepare-ssh-gpg.sh && cd dockerfile-image-update && mvn --quiet --batch-mode deploy -P release scm:tag -Drevision=${NEW_PATCH_VERSION}"
5040

5141
# Get MVN_VERSION
5242
MVN_VERSION=$(cat ./dockerfile-image-update/target/classes/version.txt)

0 commit comments

Comments
 (0)