Skip to content

Commit

Permalink
Docker Image workflow determine cnversion to use based on the guild_d…
Browse files Browse the repository at this point in the history
…eploy_branch name.

   - When branch preview/sanchonet use prerelease node version.
   - For any other branch use the original logic for latest (stable) node version.
  • Loading branch information
TrevorBenson committed Apr 28, 2024
1 parent 9e7b897 commit 6d9bfb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/docker_bin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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: |
Expand Down
2 changes: 2 additions & 0 deletions files/docker/node/dockerfile_bin
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit 6d9bfb5

Please sign in to comment.