From 6d9bfb56a07fc1aeec24a55b3ff5d1438c9e5e80 Mon Sep 17 00:00:00 2001 From: "Illuminatus [CCIO]" Date: Sat, 27 Apr 2024 15:17:10 -0700 Subject: [PATCH] Docker Image workflow determine cnversion to use based on the guild_deploy_branch name. - When branch preview/sanchonet use prerelease node version. - For any other branch use the original logic for latest (stable) node version. --- .github/workflows/docker_bin.yml | 11 ++++++++--- files/docker/node/dockerfile_bin | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_bin.yml b/.github/workflows/docker_bin.yml index 4e260d064..a84edd6ea 100644 --- a/.github/workflows/docker_bin.yml +++ b/.github/workflows/docker_bin.yml @@ -49,10 +49,14 @@ jobs: id: set_short_sha run: | echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - name: Get CNVERSION + - name: Set CNVersion id: set_cnversion run: | - echo "cnversion=$(cat files/docker/node/release-versions/cardano-node-latest.txt)" >> $GITHUB_OUTPUT + if [[ "${{ steps.set_guild_deploy_branch.outputs.guild_deploy_branch }}" == "sanchonet" ]]; then + echo "cnversion=$(cat files/docker/node/release-versions/cardano-node-prerelease.txt)" >> "$GITHUB_OUTPUT" + else + echo "cnversion=$(cat files/docker/node/release-versions/cardano-node-latest.txt)" >> "$GITHUB_OUTPUT" + fi build_production: needs: set_environment_vars if: needs.set_environment_vars.outputs.testing == 'false' && needs.set_environment_vars.outputs.guild_deploy_branch == 'master' @@ -115,7 +119,7 @@ jobs: IMAGE_NAME="$REGISTRY/$REPO/cardano-node" CNVERSION=${{ needs.set_environment_vars.outputs.cnversion }} SHA=${{ needs.set_environment_vars.outputs.short_sha }} - IMAGE_TAGS="$IMAGE_NAME:test,$IMAGE_NAME:$CNVERSION-$SHA,$IMAGE_NAME:$GUILD_DEPLOY_BRANCH-$SHA" + IMAGE_TAGS="$IMAGE_NAME:test,$IMAGE_NAME:$CNVERSION-$SHA,$IMAGE_NAME:$GUILD_DEPLOY_BRANCH-$SHA,$IMAGE_NAME:$GUILD_DEPLOY_BRANCH-$CNVERSION,,$IMAGE_NAME:$GUILD_DEPLOY_BRANCH-$CNVERSION-$SHA" echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV echo "IMAGE_TAGS=$IMAGE_TAGS" >> $GITHUB_ENV - uses: actions/checkout@v3 @@ -137,6 +141,7 @@ jobs: build-args: | G_ACCOUNT=${{ needs.set_environment_vars.outputs.g_account }} GUILD_DEPLOY_BRANCH=${{ needs.set_environment_vars.outputs.guild_deploy_branch }} + CARDANO_NODE_VERSION=${{ needs.set_environment_vars.outputs.cnversion }} - name: Add summary details if: always() run: | diff --git a/files/docker/node/dockerfile_bin b/files/docker/node/dockerfile_bin index 8edfb957a..7ecdcf952 100644 --- a/files/docker/node/dockerfile_bin +++ b/files/docker/node/dockerfile_bin @@ -7,6 +7,7 @@ LABEL desc="Cardano Node by Guild's Operators" ARG DEBIAN_FRONTEND=noninteractive ARG G_ACCOUNT=cardano-community ARG GUILD_DEPLOY_BRANCH=master +ARG CARDANO_NODE_VERSION USER root WORKDIR / @@ -60,6 +61,7 @@ RUN set -x && apt update \ RUN set -x && export SUDO='N' \ && export SKIP_DBSYNC_DOWNLOAD='Y' \ && export G_ACCOUNT=${G_ACCOUNT} \ + && export CARDANO_NODE_VERSION=${CARDANO_NODE_VERSION} \ && ./guild-deploy.sh -b ${GUILD_DEPLOY_BRANCH} -s dcmowx \ && cd /usr/bin \ && wget http://www.vdberg.org/~richard/tcpping \