From 78fa43f1d814b29a728e6558353028e1c62e7a34 Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 22 Jun 2022 17:13:55 -0700 Subject: [PATCH] Add Bash shell script to install Git in the Docker Container created from the Eclipse-Temurin JDK 17 Docker Image used to run the SSDG Gradle build (check) in Jenkins CI. --- Jenkinsfile | 1 + ci/installGit.sh | 15 +++++++++++++++ ci/setup.sh | 1 + 3 files changed, 17 insertions(+) create mode 100644 ci/installGit.sh 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