diff --git a/Jenkinsfile b/Jenkinsfile index ac2f7a2..3cd1d01 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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') } diff --git a/ci/build-and-distribute.bash b/ci/build-and-distribute.bash index 183096a..b2caf6d 100755 --- a/ci/build-and-distribute.bash +++ b/ci/build-and-distribute.bash @@ -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}." diff --git a/ci/prepare-and-build.bash b/ci/prepare-and-build.bash index 36ee4a7..b226c2a 100755 --- a/ci/prepare-and-build.bash +++ b/ci/prepare-and-build.bash @@ -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 diff --git a/src/main/resources/application-jenkins.properties b/src/main/resources/application-jenkins.properties index 48bc647..6e90099 100644 --- a/src/main/resources/application-jenkins.properties +++ b/src/main/resources/application-jenkins.properties @@ -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}