From b39cb5f7b14533c7d375b9c6793ea7abbb38999c Mon Sep 17 00:00:00 2001 From: dshuffma-ibm Date: Fri, 14 Apr 2023 13:01:13 -0400 Subject: [PATCH] bump node to 18 in dockerfile & add tag to image (#452) Signed-off-by: David Huffman --- .github/workflows/deploy.yml | 4 ++-- docker/console/Dockerfile | 4 ++-- docker/publish_image.sh | 9 ++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a8922d7e..8e25a6c6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,8 +2,8 @@ name: Docker on: push: - branches: - - main + tags: + - '*' jobs: docker: diff --git a/docker/console/Dockerfile b/docker/console/Dockerfile index 04a2daa8..b54eb921 100644 --- a/docker/console/Dockerfile +++ b/docker/console/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/nodejs-16 as client +FROM registry.access.redhat.com/ubi8/nodejs-18 as client ENV STITCH_DIR=/home/stitch ENV APOLLO_DIR=/home/apollo @@ -57,7 +57,7 @@ RUN ls -l $APOLLO_DIR/build # ---------------------------- # ------- Server Setup ------- # ---------------------------- -FROM registry.access.redhat.com/ubi8/nodejs-16 as server +FROM registry.access.redhat.com/ubi8/nodejs-18 as server ENV STITCH_DIR=/home/stitch ENV APOLLO_DIR=/home/apollo ENV SERVER_HOME=/home/athena diff --git a/docker/publish_image.sh b/docker/publish_image.sh index 7bb25fa2..d86be1eb 100755 --- a/docker/publish_image.sh +++ b/docker/publish_image.sh @@ -1,10 +1,17 @@ #!/bin/bash IMAGE_BUILD_NAME=fabric-console:latest + # Info about the build is saved in tags on the docker image -GIT_TAG=$(git describe | grep -v -) +GIT_TAG=$(git describe --tags) +echo "Found tag $GIT_TAG" +# Push the images +echo "Pushing 'latest' image:" echo ${GITHUB_TOKEN} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin docker push ghcr.io/hyperledger-labs/fabric-console:latest + +# -n means if GIT_TAG's length is greater than 0 if [[ -n $GIT_TAG ]]; then + echo "Pushing tagged image $GIT_TAG:" docker push ghcr.io/hyperledger-labs/fabric-console:${GIT_TAG} fi