Polishing.
Refine release process to update the Git state before build and distribute. See #15
This commit is contained in:
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@@ -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') }
|
||||
|
||||
@@ -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}."
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user