From 609327220268fe514e2ee51ee6a8ec635e5e8fbb Mon Sep 17 00:00:00 2001 From: TrevorBenson Date: Sun, 26 Nov 2023 08:37:06 -0800 Subject: [PATCH 1/3] remove (redundant) chmod in step 12, keep chmod in step 20 --- files/docker/node/dockerfile_bin | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/docker/node/dockerfile_bin b/files/docker/node/dockerfile_bin index d3ff4da0a..cd236533e 100644 --- a/files/docker/node/dockerfile_bin +++ b/files/docker/node/dockerfile_bin @@ -64,8 +64,7 @@ RUN set -x && export SUDO='N' \ && chmod 755 tcpping \ && chown -R guild:guild $CNODE_HOME \ && mv /root/.local/bin /home/guild/.local/ \ - && chown -R guild:guild /home/guild/.* \ - && chmod a+x /home/guild/.scripts/*.sh /opt/cardano/cnode/scripts/*.sh + && chown -R guild:guild /home/guild/.* # Add final tools in a separate layer to shrink the largest layer RUN apt-get update \ From 043d1e2b813e7a0116f83a27921b0b1514f9eb4b Mon Sep 17 00:00:00 2001 From: TrevorBenson Date: Sun, 26 Nov 2023 09:01:09 -0800 Subject: [PATCH 2/3] add input for guild deploy branch --- .github/workflows/docker_bin.yml | 11 +++++++++++ files/docker/node/dockerfile_bin | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_bin.yml b/.github/workflows/docker_bin.yml index 3b13315cc..7c7f1d565 100644 --- a/.github/workflows/docker_bin.yml +++ b/.github/workflows/docker_bin.yml @@ -2,6 +2,16 @@ name: Docker Image on: workflow_dispatch: + inputs: + guild_deploy_branch: + description: Branch to deploy + required: false + default: master + testing: + description: Testing workflow + required: false + type: boolean + default: false push: paths: - 'files/docker/node/release-versions/cardano-node-latest.txt' @@ -26,6 +36,7 @@ jobs: --file files/docker/node/dockerfile_bin \ --compress \ --build-arg G_ACCOUNT=${{ env.G_ACCOUNT }} \ + --build-arg GUILD_DEPLOY_BRANCH=${{ env.guild_deploy_branch }} \ --tag ${{ env.REGISTRY }}/${{ secrets.DOCKER_USER }}/cardano-node:latest # Workaround to provide additional free space for builds. # https://github.com/actions/virtual-environments/issues/2840 diff --git a/files/docker/node/dockerfile_bin b/files/docker/node/dockerfile_bin index cd236533e..c1df464b7 100644 --- a/files/docker/node/dockerfile_bin +++ b/files/docker/node/dockerfile_bin @@ -6,6 +6,7 @@ STOPSIGNAL SIGINT LABEL desc="Cardano Node by Guild's Operators" ARG DEBIAN_FRONTEND=noninteractive ARG G_ACCOUNT +ARG GUILD_DEPLOY_BRANCH USER root WORKDIR / @@ -45,7 +46,7 @@ RUN set -x && apt update \ && export SUDO='N' \ && export UPDATE_CHECK='N' \ && export SKIP_DBSYNC_DOWNLOAD='Y' \ - && chmod +x ./guild-deploy.sh && ./guild-deploy.sh -b master -s p \ + && chmod +x ./guild-deploy.sh && ./guild-deploy.sh -b ${GUILD_DEPLOY_BRANCH} -s p \ && ls /opt/ \ && mkdir -p $CNODE_HOME/priv/files \ && apt-get -y remove libpq-dev build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ \ @@ -58,7 +59,7 @@ RUN set -x && apt update \ RUN set -x && export SUDO='N' \ && export UPDATE_CHECK='N' \ && export SKIP_DBSYNC_DOWNLOAD='Y' \ - && ./guild-deploy.sh -b master -s dcmowx \ + && ./guild-deploy.sh -b ${GUILD_DEPLOY_BRANCH} -s dcmowx \ && cd /usr/bin \ && wget http://www.vdberg.org/~richard/tcpping \ && chmod 755 tcpping \ From c29187c0bf2d9538eda717964f557e0b6c128d4f Mon Sep 17 00:00:00 2001 From: TrevorBenson Date: Sun, 26 Nov 2023 09:04:57 -0800 Subject: [PATCH 3/3] Skip pushing to registries if testing the workflow --- .github/workflows/docker_bin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker_bin.yml b/.github/workflows/docker_bin.yml index 7c7f1d565..a56fe0bf6 100644 --- a/.github/workflows/docker_bin.yml +++ b/.github/workflows/docker_bin.yml @@ -53,6 +53,7 @@ jobs: sudo rm -rf "/usr/local/share/boost" sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: docker push latest + if: env.testing == 'false' && env.guild_deploy_branch == 'master' run: | CNVERSION=`cat files/docker/node/release-versions/cardano-node-latest.txt` docker push ${{ env.REGISTRY }}/${{ secrets.DOCKER_USER }}/cardano-node:latest