From 7f2a6749f5579febbd10d4a5b7cda57413e6a2c7 Mon Sep 17 00:00:00 2001 From: Jade Carino Date: Tue, 17 Sep 2024 12:32:58 +0100 Subject: [PATCH] Create new testing image Signed-off-by: Jade Carino --- .github/workflows/build.yml | 34 ++++++++++++++++++++ dockerfiles/dockerfile.galasactl | 29 ++--------------- dockerfiles/dockerfile.galasactl-ibm-testing | 10 ++++++ 3 files changed, 46 insertions(+), 27 deletions(-) create mode 100644 dockerfiles/dockerfile.galasactl-ibm-testing diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fbbd922..ab18ec77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -184,6 +184,40 @@ jobs: run: | docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app wait ${{ env.BRANCH }}-cli --resource apps:Deployment:cli-${{ env.BRANCH }} --health --server argocd.galasa.dev + build-galasactl-ibm-testing-image-and-trigger-tekton-pipeline: + name: Build image containing galasactl, OpenJDK and Gradle for testing + runs-on: ubuntu-latest + needs: build-cli + + steps: + - name: Checkout CLI + uses: actions/checkout@v4 + + - name: Login to Github Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for galasactl-ibm-testing image + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/galasactl-ibm-x86_64-testing + + - name: Build galasactl-ibm-testing image + id: build + uses: docker/build-push-action@v5 + with: + context: . + file: dockerfiles/dockerfile.galasactl-ibm-testing + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + branch=${{ env.BRANCH }} + - name: Attempt to trigger test-cli-ecosystem-commands Tekton pipeline run: | echo "The Tekton pipeline test-cli-ecosystem-commands should be triggered in the next 2-minutes - check the Tekton dashboard" \ No newline at end of file diff --git a/dockerfiles/dockerfile.galasactl b/dockerfiles/dockerfile.galasactl index 2c3cbc9b..6390dc5f 100644 --- a/dockerfiles/dockerfile.galasactl +++ b/dockerfiles/dockerfile.galasactl @@ -1,32 +1,7 @@ FROM harbor.galasa.dev/docker_proxy_cache/library/ubuntu:20.04 -# Install Java and Gradle as they are pre-reqs for galasactl -ENV GRADLE_VERSION=8.9 -ENV GRADLE_HOME=/opt/gradle - -RUN apt-get update && \ - apt-get install -y \ - ca-certificates \ - openjdk-17-jdk \ - wget \ - unzip \ - tar && \ - # Install Gradle - wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -O /tmp/gradle.zip && \ - mkdir -p ${GRADLE_HOME} && \ - unzip /tmp/gradle.zip -d ${GRADLE_HOME} && \ - rm /tmp/gradle.zip && \ - ln -s ${GRADLE_HOME}/gradle-${GRADLE_VERSION} ${GRADLE_HOME}/latest && \ - ln -s ${GRADLE_HOME}/latest/bin/gradle /usr/local/bin/gradle && \ - # Clean up - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 -ENV PATH="$JAVA_HOME/bin:$PATH" - -RUN java -version && \ - gradle --version +RUN apt-get update \ + && apt-get install -y ca-certificates ARG platform diff --git a/dockerfiles/dockerfile.galasactl-ibm-testing b/dockerfiles/dockerfile.galasactl-ibm-testing new file mode 100644 index 00000000..179ac19b --- /dev/null +++ b/dockerfiles/dockerfile.galasactl-ibm-testing @@ -0,0 +1,10 @@ +FROM ghcr.io/galasa-dev/openjdk17-ibm-gradle:main + +ARG branch + +RUN wget https://development.galasa.dev/${branch}/binary/cli/galasactl-linux-x86_64 -O /usr/local/bin/galasactl && \ + chmod +x /usr/local/bin/galasactl + +RUN galasactl --version + +ENV PATH="/usr/local/bin:$PATH" \ No newline at end of file