Move 'docker login' command to setup.sh.
Move 'chown' and and 'mkdir /tmp/jenkins-home' commmands to setup.sh. Add 'exit 0' commands to the cleanup Bash shell scripts. Add 'echo' commands to log build progress.
This commit is contained in:
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
@@ -33,9 +33,12 @@ pipeline {
|
||||
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
|
||||
docker.image('adoptopenjdk/openjdk8:latest').inside('-u root -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v $HOME:/tmp/jenkins-home') {
|
||||
|
||||
sh "echo 'Setting up build environment...'"
|
||||
sh "ci/setup.sh"
|
||||
|
||||
// Cleanup any prior build system resources
|
||||
try {
|
||||
sh "echo 'Cleaning up build artifacts & old GemFire/Geode files...'"
|
||||
sh "echo 'Cleaning up build artifacts & GemFire/Geode files...'"
|
||||
sh "ci/cleanupGemFiles.sh"
|
||||
sh "ci/cleanupArtifacts.sh"
|
||||
}
|
||||
@@ -43,7 +46,7 @@ pipeline {
|
||||
|
||||
// Run the SBDG project Gradle build using JDK 8 inside Docker
|
||||
try {
|
||||
sh "docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW}"
|
||||
sh "echo 'Building SBDG...'"
|
||||
sh "ci/check.sh"
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
set -eou pipefail
|
||||
mkdir -p /tmp/jenkins-home
|
||||
chown -R 1001:1001 .
|
||||
|
||||
GRADLE_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" \
|
||||
./gradlew --no-daemon --refresh-dependencies --stacktrace clean check
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
set -eou pipefail
|
||||
chown -R 1001:1001 .
|
||||
rm -Rf ./.gradle
|
||||
rm -Rf ./.m2
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
set -eou pipefail
|
||||
chown -R 1001:1001 .
|
||||
rm -Rf `find . -name "BACKUPDEFAULT*"`
|
||||
rm -Rf `find . -name "ConfigDiskDir*"`
|
||||
rm -Rf `find . -name "locator*" | grep -v "src" | grep -v "locator-application"`
|
||||
rm -Rf `find . -name "newDB"`
|
||||
rm -Rf `find . -name "server" | grep -v "src"`
|
||||
rm -Rf `find . -name "*.log"`
|
||||
exit 0
|
||||
|
||||
7
ci/setup.sh
Executable file
7
ci/setup.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
mkdir -p /tmp/jenkins-home
|
||||
chown -R 1001:1001 .
|
||||
echo "Logging into Docker..."
|
||||
docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW}
|
||||
exit 0
|
||||
Reference in New Issue
Block a user