From 8cec9f725bf85edfd09b0e5b47d29c7e255d5c14 Mon Sep 17 00:00:00 2001 From: dkatzz <86739416+dkatzz@users.noreply.github.com> Date: Wed, 9 Aug 2023 18:26:50 -0400 Subject: [PATCH 1/2] Update build-pgdmin --- cloud/aws/pgadmin/build-pgdmin | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/cloud/aws/pgadmin/build-pgdmin b/cloud/aws/pgadmin/build-pgdmin index b36a6fb5..03dd23f2 100755 --- a/cloud/aws/pgadmin/build-pgdmin +++ b/cloud/aws/pgadmin/build-pgdmin @@ -2,8 +2,24 @@ # Builds the customized pgadmin Docker image. -docker build \ - -t docker.io/civiform/pgadmin:latest \ - -f pgadmin.Dockerfile . +set -e +set +x + +readonly SHORT_SHA="$(git rev-parse --short HEAD)" +readonly DATE_IN_UNIX_SECONDS="$(date +%s)" +readonly SNAPSHOT_TAG="SNAPSHOT-${SHORT_SHA}-${DATE_IN_UNIX_SECONDS}" +readonly IMAGE="pgadmin" -docker push docker.io/civiform/pgadmin:latest +PLATFORM_ARG=() +if [[ -n "${PLATFORM}" ]]; then + PLATFORM_ARG=(--platform "${PLATFORM}") +fi +readonly PLATFORM_ARG + +echo "start ${IMAGE} build" +docker buildx create --use +docker buildx build --push \ + "${PLATFORM_ARG[@]}" \ + -t "docker.io/civiform/${IMAGE}:latest" \ + -t "docker.io/civiform/${IMAGE}:${SNAPSHOT_TAG}" \ + -f pgadmin.Dockerfile . From 752ed3b75bb16bb707fcb1fb50bedeb3fb97b6d3 Mon Sep 17 00:00:00 2001 From: dkatzz <86739416+dkatzz@users.noreply.github.com> Date: Thu, 10 Aug 2023 11:08:47 -0400 Subject: [PATCH 2/2] Update build-pgdmin --- cloud/aws/pgadmin/build-pgdmin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/aws/pgadmin/build-pgdmin b/cloud/aws/pgadmin/build-pgdmin index 03dd23f2..bd29809b 100755 --- a/cloud/aws/pgadmin/build-pgdmin +++ b/cloud/aws/pgadmin/build-pgdmin @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#! /usr/bin/env bash # Builds the customized pgadmin Docker image.