From a1aa13ce8eefaa91b2170e8c77e81c2190c1dd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Mon, 4 Sep 2023 12:01:32 +0200 Subject: [PATCH] Add Gradle installation to the container image Closes gh-19 --- ci/images/ci-image/Dockerfile | 3 ++- ci/images/get-gradle-url.sh | 5 +++++ ci/images/setup.sh | 11 ++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100755 ci/images/get-gradle-url.sh diff --git a/ci/images/ci-image/Dockerfile b/ci/images/ci-image/Dockerfile index 0fea854..7e63599 100644 --- a/ci/images/ci-image/Dockerfile +++ b/ci/images/ci-image/Dockerfile @@ -5,10 +5,11 @@ ADD get-crac-jdk-url.sh /get-crac-jdk-url.sh ADD get-docker-url.sh /get-docker-url.sh ADD get-ytt-url.sh /get-ytt-url.sh ADD get-docker-compose-url.sh /get-docker-compose-url.sh +ADD get-gradle-url.sh /get-gradle-url.sh RUN ./setup.sh ENV JAVA_HOME /opt/crac-jdk -ENV PATH $JAVA_HOME/bin:/opt/ytt/bin:/opt/docker-compose/bin:$PATH +ENV PATH $JAVA_HOME/bin:/opt/ytt/bin:/opt/docker-compose/bin:/opt/gradle/bin:$PATH ENV GRADLE_OPTS -Dorg.gradle.project.buildDir=/tmp/gradle-build RUN git config --global --add safe.directory /workspace ADD docker-lib.sh /docker-lib.sh diff --git a/ci/images/get-gradle-url.sh b/ci/images/get-gradle-url.sh new file mode 100755 index 0000000..f59c4d7 --- /dev/null +++ b/ci/images/get-gradle-url.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +VERSION="8.3" +echo "https://services.gradle.org/distributions/gradle-$VERSION-bin.zip" diff --git a/ci/images/setup.sh b/ci/images/setup.sh index 508872e..7f3e227 100755 --- a/ci/images/setup.sh +++ b/ci/images/setup.sh @@ -9,7 +9,7 @@ export ARCH=$(uname -m) export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get install --no-install-recommends -y tzdata ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq unzip build-essential libz-dev libfreetype-dev nano +apt-get install --no-install-recommends -y tzdata ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq unzip build-essential libz-dev libfreetype-dev nano libarchive-tools ln -fs /usr/share/zoneinfo/UTC /etc/localtime dpkg-reconfigure --frontend noninteractive tzdata rm -rf /var/lib/apt/lists/* @@ -51,7 +51,12 @@ curl --location $DOCKER_COMPOSE_URL > /opt/docker-compose/bin/docker-compose chmod +x /opt/docker-compose/bin/docker-compose ########################################################### -# GRADLE ENTERPRISE +# GRADLE ########################################################### +GRADLE_URL=$( /get-gradle-url.sh ) +mkdir -p /opt/gradle +cd /opt/gradle +curl -L $GRADLE_URL | bsdtar --strip-components=1 -xvf- +chmod +x /opt/gradle/bin/gradle mkdir ~/.gradle -echo 'systemProp.user.name=concourse' > ~/.gradle/gradle.properties \ No newline at end of file +echo 'systemProp.user.name=concourse' > ~/.gradle/gradle.properties