Skip to content

Commit

Permalink
Allow AWSCLI_VERSION to be set from the environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Apr 12, 2021
1 parent 3b6c6de commit 1ba62c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/packager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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***"
Expand Down
4 changes: 2 additions & 2 deletions packaging/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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)" && \
gpg2 --import ./awscli-key.gpg && \
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 && \
Expand Down
5 changes: 4 additions & 1 deletion packaging/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ba62c4

Please sign in to comment.