diff --git a/Jenkinsfile b/Jenkinsfile index 7c20de1..43975e0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,6 +32,7 @@ pipeline { docker.image(p['docker.container.image.java.main']).inside(p['docker.container.inside.env.full']) { withCredentials([GRADLE_ENTERPRISE_SECRET_ACCESS_KEY]) { withEnv(["GRADLE_ENTERPRISE_ACCESS_KEY=${GRADLE_ENTERPRISE_ACCESS_KEY}"]) { + sh "echo 'Setup build environment...'" sh "ci/setup.sh" diff --git a/ci/installGit.sh b/ci/installGit.sh new file mode 100644 index 0000000..c994766 --- /dev/null +++ b/ci/installGit.sh @@ -0,0 +1,15 @@ +#!/bin/bash -x + +which git +git --version 2>1 /dev/null + +gitVersionCommandReturnValue=$? + +if test "$gitVersionCommandReturnValue" != 0 +then + echo "Installing Git..." + apt-get -y update + apt-get -y install git + which git + git --version +fi diff --git a/ci/setup.sh b/ci/setup.sh index 2bc4484..0850602 100755 --- a/ci/setup.sh +++ b/ci/setup.sh @@ -8,4 +8,5 @@ echo "Logged into Jenkins CI as user [$USER] with home directory [$HOME] in the chown -R 1001:1001 . #echo "Logging into Docker..." #docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW} +source ci/installGit.sh exit 0