From 1ba62c4184b56c480ebf2649bd0d85ea901acad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Mon, 12 Apr 2021 10:18:36 +0200 Subject: [PATCH] Allow AWSCLI_VERSION to be set from the environment Resolves https://github.com/k6io/k6/pull/1916#discussion_r610733205 --- .github/workflows/packager.yml | 7 ++++--- packaging/Dockerfile | 4 ++-- packaging/docker-compose.yml | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/packager.yml b/.github/workflows/packager.yml index 232ca8c23..ddaaee204 100644 --- a/.github/workflows/packager.yml +++ b/.github/workflows/packager.yml @@ -12,6 +12,10 @@ defaults: jobs: publish-packager: runs-on: ubuntu-latest + env: + VERSION: 0.0.1 + AWSCLI_VERSION: 2.1.36 + DOCKER_IMAGE_ID: k6io/k6packager steps: - name: Checkout code uses: actions/checkout@v2 @@ -20,9 +24,6 @@ jobs: cd packaging docker-compose build packager - name: Publish - env: - VERSION: 0.0.1 - DOCKER_IMAGE_ID: k6io/k6packager run: | echo "$***REMOVED******REMOVED*** secrets.CR_PAT ***REMOVED******REMOVED***" | docker login https://ghcr.io -u $***REMOVED******REMOVED*** github.actor ***REMOVED******REMOVED*** --password-stdin docker tag "$DOCKER_IMAGE_ID" "ghcr.io/$***REMOVED***DOCKER_IMAGE_ID***REMOVED***:$***REMOVED***VERSION***REMOVED***" diff --git a/packaging/Dockerfile b/packaging/Dockerfile index 1f456c626..59ef696a9 100644 --- a/packaging/Dockerfile +++ b/packaging/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update -y && \ COPY ./awscli-key.gpg . -ARG AWSCLI_VERSION=2.1.35 +ARG AWSCLI_VERSION # Download awscli, check GPG signature and install. RUN export GNUPGHOME="$(mktemp -d)" && \ @@ -17,7 +17,7 @@ RUN export GNUPGHOME="$(mktemp -d)" && \ fpr="$(gpg2 --with-colons --fingerprint aws-cli | grep '^fpr' | cut -d: -f10)" && \ gpg2 --export-ownertrust && echo "$***REMOVED***fpr***REMOVED***:6:" | gpg2 --import-ownertrust && \ curl -fsSL --remote-name-all \ - "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-$***REMOVED***AWSCLI_VERSION***REMOVED***.zip"***REMOVED***,.sig***REMOVED*** && \ + "https://awscli.amazonaws.com/awscli-exe-linux-x86_64$***REMOVED***AWSCLI_VERSION:+-$AWSCLI_VERSION***REMOVED***.zip"***REMOVED***,.sig***REMOVED*** && \ gpg2 --verify awscli*.sig awscli*.zip && \ unzip -q awscli*.zip && \ ./aws/install && \ diff --git a/packaging/docker-compose.yml b/packaging/docker-compose.yml index 9ad7a2d97..6ad7d932b 100644 --- a/packaging/docker-compose.yml +++ b/packaging/docker-compose.yml @@ -2,7 +2,10 @@ version: '3.4' services: packager: - build: . + build: + context: . + args: + - AWSCLI_VERSION=$***REMOVED***AWSCLI_VERSION:-2.1.36***REMOVED*** image: ghcr.io/k6io/k6packager:latest environment: - AWS_ACCESS_KEY_ID