Skip to content

Commit 9ffafe6

Browse files
committed
#130 Consolidate the environment properties into the .releasing.env file and let Docker use that instead of manually passing each along.
This now also allows a dryRun property to come across easily.
1 parent b192603 commit 9ffafe6

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

RELEASING.md

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ $ ssh-add
120120
#These next 2 drive the Maven Release plugin
121121
#RELEASE_VERSION=1.2.1
122122
#DEVELOPMENT_VERSION=1.2.2-SNAPSHOT
123+
#SET this to 'true' if you want to perform a test/dry-run of the release process without actually doing it.
124+
#DRY_RUN=false
123125
124126
# Run the Release script
125127
./releasing.sh

releasing-scripts/docker-release-build.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ echo allow-preset-passphrase >> /root/.gnupg/gpg-agent.conf
1313
echo "Importing GPGKEY"
1414
# this trick allows the GPG secret key to be imported via the command line
1515
# thank goodness for Google
16-
echo $MAVEN_GPG_PASSPHRASE | gpg --batch --yes --passphrase-fd 0 --import /root/gpgkeyexport/gpgkey.prvt.asc
16+
echo $GPG_PASSPHRASE | gpg --batch --yes --passphrase-fd 0 --import /root/gpgkeyexport/gpgkey.prvt.asc
1717

1818
# now iterate over each KEYGRIP you can see and preset the passphrase (one of them will be the right one)
1919
echo "Dumping keygrips"
2020
gpg --list-secret-keys --with-keygrip
21-
for KEYGRIP in `gpg --list-secret-keys --with-keygrip | grep Keygrip | awk -F = '{print $2}'`; do /usr/libexec/gpg-preset-passphrase --preset --passphrase $MAVEN_GPG_PASSPHRASE $KEYGRIP; done
21+
for KEYGRIP in `gpg --list-secret-keys --with-keygrip | grep Keygrip | awk -F = '{print $2}'`; do /usr/libexec/gpg-preset-passphrase --preset --passphrase $GPG_PASSPHRASE $KEYGRIP; done
2222

2323
# now do a simple GPG sign to 'prime' the gpg to ensure when Maven ends up running this GPG cache thing is ready
2424
echo "Doing a fake GPG signing now to prime the GPG agent password cache"
@@ -38,4 +38,5 @@ git config --global user.name "$GIT_USERNAME"
3838
git config --global --list
3939

4040
echo "Building Parfait"
41-
MAVEN_GPG_PASSPHRASE=$MAVEN_GPG_PASSPHRASE mvn --batch-mode release:prepare release:perform -DreleaseVersion="${RELEASE_VERSION}" -DdevelopmentVersion="${DEVELOPMENT_VERSION}"
41+
MAVEN_GPG_PASSPHRASE=$GPG_PASSPHRASE mvn --batch-mode -DdryRun=${DRY_RUN} -DreleaseVersion="${RELEASE_VERSION}" -DdevelopmentVersion="${DEVELOPMENT_VERSION}" release:prepare
42+

releasing.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ docker build . -t parfait-builder
1919
# * mounts your GPG exported key (see RELEASING.md for the requirements there)
2020
# * mounts the SSH_AUTH_SOCK so you can leverage your local SSH agent
2121
# * then launches the releasing-scripts/docker-release-build.sh to perform the build inside the container
22-
docker run --rm --env GIT_USERNAME="${GIT_USERNAME}" --env GIT_EMAIL="${GIT_EMAIL}" --env MAVEN_GPG_PASSPHRASE="${GPG_PASSPHRASE}" --env SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock" --volume `pwd`:/parfait --volume ~/.m2:/root/.m2 --volume ~/gpgkeyexport:/root/gpgkeyexport --mount type=bind,src=/run/host-services/ssh-auth.sock,target=/run/host-services/ssh-auth.sock parfait-builder sh -c 'releasing-scripts/docker-release-build.sh'
22+
docker run --rm --env-file .releasing.env --env SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock" --volume `pwd`:/parfait --volume ~/.m2:/root/.m2 --volume ~/gpgkeyexport:/root/gpgkeyexport --mount type=bind,src=/run/host-services/ssh-auth.sock,target=/run/host-services/ssh-auth.sock parfait-builder sh -c 'releasing-scripts/docker-release-build.sh'
2323

2424

2525

0 commit comments

Comments
 (0)