Polishing.

Refine release process to update the Git state before build and distribute.

See #15
This commit is contained in:
Mark Paluch
2023-01-13 10:35:58 +01:00
parent 5d73696815
commit 1f500f38b4
4 changed files with 18 additions and 8 deletions

4
Jenkinsfile vendored
View File

@@ -25,7 +25,7 @@ pipeline {
steps {
script {
def image = docker.build("springci/spring-data-release-tools:0.3", "ci")
def image = docker.build("springci/spring-data-release-tools:0.4", "ci")
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
image.push()
}
@@ -39,7 +39,7 @@ pipeline {
}
agent {
docker {
image 'springci/spring-data-release-tools:0.3'
image 'springci/spring-data-release-tools:0.4'
}
}
options { timeout(time: 4, unit: 'HOURS') }

View File

@@ -11,9 +11,17 @@ export PATH="$MAVEN_HOME/bin:$JAVA_HOME/bin:$PATH"
export JENKINS_HOME=/tmp/jenkins-home
export RELEASE_TOOLS_CACHE=${JENKINS_HOME}/.m2/spring-data-release-tools
export LOGS_DIR=${JENKINS_HOME}/spring-data-shell/logs
export LOGS_DIR=$(pwd)/logs
export SETTINGS_XML=${JENKINS_HOME}/settings.xml
mkdir -p ${RELEASE_TOOLS_CACHE}
mkdir -p ${LOGS_DIR}
export GNUPGHOME=~/.gnupg/
mkdir -p ${GNUPGHOME}
chmod 700 ${GNUPGHOME}
cp ci/settings.xml ${JENKINS_HOME}
if test -f application-local.properties; then
echo "You are running from dev environment! Using application-local.properties."
@@ -23,19 +31,21 @@ if test -f application-local.properties; then
function spring-data-release-shell {
java \
-jar target/spring-data-release-cli.jar \
--cmdfile target/push-and-distribute.shell
--cmdfile target/build-and-distribute.shell
}
else
echo "You are running inside Jenkins! Using parameters fed from the agent."
echo "${GIT_SIGNING_KEY_PASSWORD}" | /usr/bin/gpg --batch --yes --passphrase-fd 0 --import "${GIT_SIGNING_KEY}"
echo "${MAVEN_SIGNING_KEY_PASSWORD}" | /usr/bin/gpg --batch --yes --passphrase-fd 0 --import "${MAVEN_SIGNING_KEY}"
/usr/bin/gpg -k
function spring-data-release-shell {
java \
-Dspring.profiles.active=jenkins \
-Dmaven.home=${MAVEN_HOME} \
-jar target/spring-data-release-cli.jar \
--cmdfile target/push-and-distribute.shell
--cmdfile target/build-and-distribute.shell
}
fi
echo "About to push and distribute ${VERSION}."

View File

@@ -36,7 +36,6 @@ if test -f application-local.properties; then
else
echo "You are running inside Jenkins! Using parameters fed from the agent."
mkdir -p ~/.gnupg
echo "${GIT_SIGNING_KEY_PASSWORD}" | /usr/bin/gpg --batch --yes --passphrase-fd 0 --import "${GIT_SIGNING_KEY}"
echo "${MAVEN_SIGNING_KEY_PASSWORD}" | /usr/bin/gpg --batch --yes --passphrase-fd 0 --import "${MAVEN_SIGNING_KEY}"
/usr/bin/gpg -k

View File

@@ -23,6 +23,7 @@ sagan.key=n/a
maven.maven-home=${MAVEN_HOME}
maven.console-logger=false
maven.local-repository=${RELEASE_TOOLS_CACHE}
maven.parallelize=true
io.workDir=dist
io.logs=${LOGS_DIR}