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 46e0a1a commit dec4712
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 "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
docker tag "$DOCKER_IMAGE_ID" "ghcr.io/${DOCKER_IMAGE_ID}:${VERSION}"
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 "${fpr}:6:" | gpg2 --import-ownertrust && \
curl -fsSL --remote-name-all \
"https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWSCLI_VERSION}.zip"{,.sig} && \
"https://awscli.amazonaws.com/awscli-exe-linux-x86_64${AWSCLI_VERSION:+-$AWSCLI_VERSION}.zip"{,.sig} && \
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=${AWSCLI_VERSION:-2.1.36}
image: ghcr.io/k6io/k6packager:latest
environment:
- AWS_ACCESS_KEY_ID
Expand Down

0 comments on commit dec4712

Please sign in to comment.