From 3d2d8013697f9ab9990bf3e630b1a8e7988af560 Mon Sep 17 00:00:00 2001 From: Thibault Jamet Date: Mon, 9 Mar 2020 22:44:21 +0100 Subject: [PATCH 1/4] Add VERSION argument to python packages First step in fixing #33 --- .github/workflows/push.yml | 11 +++++++++++ ansible/Dockerfile | 4 +++- awscli/Dockerfile | 3 ++- awslogs/Dockerfile | 3 ++- httpie/Dockerfile | 3 ++- jq/Dockerfile | 8 ++++++-- proselint/Dockerfile | 3 ++- pygmentize/Dockerfile | 3 ++- youtube-dl/Dockerfile | 3 ++- 9 files changed, 32 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b7efb6b..8d048cb 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -91,12 +91,23 @@ jobs: if: steps.is-modified.outputs.modified == 'true' || (github.event_name == 'push' && github.event.ref == 'refs/heads/re-builld-all') - run: | docker build -t ${{ matrix.image }} ${{ matrix.image }} + if [ -e "${{ matrix.image }}/tags.yaml" ]; then + for tag in $(cat "${{ matrix.image }}/tags.yaml" | docker run --rm -i whalebrew/yq -r '.versions[]'); do + docker build -t ${{ matrix.image }}:${tag} --build-arg VERSION=${tag} ${{ matrix.image }} + done + fi if: steps.is-modified.outputs.modified == 'true' || (github.event_name == 'push' && github.event.ref == 'refs/heads/re-builld-all') - run: | echo ${{ secrets.DOCKER_HUB_PASSWORD }} | base64 -d | docker login --password-stdin -u whalebrewci echo ${{ github.token }} | docker login --password-stdin -u ${{ github.actor }} docker.pkg.github.com docker tag ${{ matrix.image }} ${{ github.event.repository.owner.name}}/${{ matrix.image }} docker tag ${{ matrix.image }} docker.pkg.github.com/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }} + if [ -e "${{ matrix.image }}/tags.yaml" ]; then + for tag in $(cat "${{ matrix.image }}/tags.yaml" | docker run --rm -i whalebrew/yq -r '.versions[]'); do + docker tag ${{ matrix.image }}:${tag} ${{ github.event.repository.owner.name}}/${{ matrix.image }}:${tag} + docker tag ${{ matrix.image }}:${tag} docker.pkg.github.com/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }}:${tag} + done + fi docker push ${{ github.event.repository.owner.name}}/${{ matrix.image }} docker push docker.pkg.github.com/${{ github.event.repository.owner.name}}/${{ github.event.repository.name }}/${{ matrix.image }} if: github.event_name == 'push' && ( steps.is-modified.outputs.modified == 'true' || github.event.ref == 'refs/heads/re-builld-all') \ No newline at end of file diff --git a/ansible/Dockerfile b/ansible/Dockerfile index 6d2c6e8..f0eb1a7 100644 --- a/ansible/Dockerfile +++ b/ansible/Dockerfile @@ -1,5 +1,7 @@ FROM alpine:latest +ARG VERSION=2.9.6 + RUN apk --update upgrade && \ apk add \ py-pip \ @@ -15,7 +17,7 @@ RUN apk --update upgrade && \ ## Adding boto and boto3 for AWS modules. This can obviously be expanded as needed RUN pip install --no-cache-dir \ pycparser==2.13 \ - ansible \ + ansible${VERSION+==$VERSION} \ boto \ boto3 diff --git a/awscli/Dockerfile b/awscli/Dockerfile index d7b7e09..11d237d 100644 --- a/awscli/Dockerfile +++ b/awscli/Dockerfile @@ -1,6 +1,7 @@ FROM python:alpine RUN apk add --no-cache groff less mailcap -RUN pip install awscli +ARG VERSION=1.18.17 +RUN pip install awscli${VERSION+==$VERSION} LABEL io.whalebrew.name aws LABEL io.whalebrew.config.environment '["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "AWS_DEFAULT_REGION", "AWS_DEFAULT_PROFILE", "AWS_CONFIG_FILE"]' LABEL io.whalebrew.config.volumes '["~/.aws:/.aws"]' diff --git a/awslogs/Dockerfile b/awslogs/Dockerfile index aeb9c5c..575fe2b 100644 --- a/awslogs/Dockerfile +++ b/awslogs/Dockerfile @@ -1,5 +1,6 @@ FROM python:alpine -RUN pip install awslogs +ARG VERSION=0.8.0 +RUN pip install awslogs${VERSION+==$VERSION} LABEL io.whalebrew.name awslogs LABEL io.whalebrew.config.environment '["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "AWS_DEFAULT_REGION", "AWS_DEFAULT_PROFILE", "AWS_CONFIG_FILE"]' LABEL io.whalebrew.config.volumes '["~/.aws:/.aws"]' diff --git a/httpie/Dockerfile b/httpie/Dockerfile index a108da0..96de979 100644 --- a/httpie/Dockerfile +++ b/httpie/Dockerfile @@ -1,4 +1,5 @@ FROM python:3-alpine -RUN pip install httpie +ARG VERSION=2.0.0 +RUN pip install httpie${VERSION+==$VERSION} RUN mkdir /.httpie && echo "{}" > /.httpie/config.json ENTRYPOINT ["http"] diff --git a/jq/Dockerfile b/jq/Dockerfile index 705a664..ffd4763 100644 --- a/jq/Dockerfile +++ b/jq/Dockerfile @@ -1,3 +1,7 @@ -FROM alpine -RUN apk add --no-cache jq +FROM alpine as build +ARG VERSION=1.6 +RUN wget -O /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-${VERSION}/jq-linux64 && \ + chmod +x /usr/local/bin/jq +FROM scratch +COPY --from=build /usr/local/bin/jq /usr/local/bin/jq ENTRYPOINT ["jq"] diff --git a/proselint/Dockerfile b/proselint/Dockerfile index 01f7746..a9e3e0b 100644 --- a/proselint/Dockerfile +++ b/proselint/Dockerfile @@ -1,3 +1,4 @@ FROM python:3-alpine -RUN pip install proselint +ARG VERSION= +RUN pip install proselint${VERSION+==$VERSION} ENTRYPOINT ["proselint"] diff --git a/pygmentize/Dockerfile b/pygmentize/Dockerfile index 335b814..a37cc82 100644 --- a/pygmentize/Dockerfile +++ b/pygmentize/Dockerfile @@ -1,3 +1,4 @@ FROM python:3-alpine -RUN pip install pygments +ARG VERSION=2.6.1 +RUN pip install pygments${VERSION+==$VERSION} ENTRYPOINT ["pygmentize"] diff --git a/youtube-dl/Dockerfile b/youtube-dl/Dockerfile index fbfc78b..06b8652 100644 --- a/youtube-dl/Dockerfile +++ b/youtube-dl/Dockerfile @@ -1,4 +1,5 @@ FROM python:3-alpine RUN apk add --no-cache ffmpeg -RUN pip install youtube-dl +ARG VERSION=2020.3.8 +RUN pip install --no-cache-dir youtube-dl${VERSION+==$VERSION} ENTRYPOINT ["youtube-dl"] From 44ffa9605a9c7b3e44a34c66d72603214f6d1f99 Mon Sep 17 00:00:00 2001 From: Thibault Jamet Date: Tue, 10 Mar 2020 00:05:13 +0100 Subject: [PATCH 2/4] Group output by image tag --- .github/workflows/push.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 8d048cb..7ab11a7 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -90,10 +90,14 @@ jobs: - uses: actions/checkout@v1 if: steps.is-modified.outputs.modified == 'true' || (github.event_name == 'push' && github.event.ref == 'refs/heads/re-builld-all') - run: | - docker build -t ${{ matrix.image }} ${{ matrix.image }} + echo ::group::build image ${{ matrix.image }}:latest + docker build -t ${{ matrix.image }} ${{ matrix.image }} + echo ::endgroup:: if [ -e "${{ matrix.image }}/tags.yaml" ]; then for tag in $(cat "${{ matrix.image }}/tags.yaml" | docker run --rm -i whalebrew/yq -r '.versions[]'); do - docker build -t ${{ matrix.image }}:${tag} --build-arg VERSION=${tag} ${{ matrix.image }} + echo ::group::build image ${{ matrix.image }}:${tag} + docker build -t ${{ matrix.image }}:${tag} --build-arg VERSION=${tag} ${{ matrix.image }} + echo ::endgroup:: done fi if: steps.is-modified.outputs.modified == 'true' || (github.event_name == 'push' && github.event.ref == 'refs/heads/re-builld-all') From a6036a49cbe1dbe755cd57e04f158155320ddc90 Mon Sep 17 00:00:00 2001 From: Thibault Jamet Date: Tue, 10 Mar 2020 00:06:29 +0100 Subject: [PATCH 3/4] Fix proselint build --- proselint/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proselint/Dockerfile b/proselint/Dockerfile index a9e3e0b..6a4271a 100644 --- a/proselint/Dockerfile +++ b/proselint/Dockerfile @@ -1,4 +1,4 @@ FROM python:3-alpine -ARG VERSION= +ARG VERSION=0.9.0 RUN pip install proselint${VERSION+==$VERSION} ENTRYPOINT ["proselint"] From b22b749f233d18c2be6a2abc5a3ba855ee50cee4 Mon Sep 17 00:00:00 2001 From: Thibault Jamet Date: Tue, 10 Mar 2020 00:07:37 +0100 Subject: [PATCH 4/4] Add image tag list --- ansible/tags.yaml | 19 +++++++++++++++++++ awscli/tags.yaml | 37 +++++++++++++++++++++++++++++++++++++ awslogs/tags.yaml | 3 +++ httpie/tags.yaml | 5 +++++ jq/tags.yaml | 3 +++ proselint/tags.yaml | 3 +++ pygmentize/tags.yaml | 5 +++++ youtube-dl/tags.yaml | 8 ++++++++ yq/tags.yaml | 4 ++++ 9 files changed, 87 insertions(+) create mode 100644 ansible/tags.yaml create mode 100644 awscli/tags.yaml create mode 100644 awslogs/tags.yaml create mode 100644 httpie/tags.yaml create mode 100644 jq/tags.yaml create mode 100644 proselint/tags.yaml create mode 100644 pygmentize/tags.yaml create mode 100644 youtube-dl/tags.yaml create mode 100644 yq/tags.yaml diff --git a/ansible/tags.yaml b/ansible/tags.yaml new file mode 100644 index 0000000..4446981 --- /dev/null +++ b/ansible/tags.yaml @@ -0,0 +1,19 @@ +versions: +- 2.8.0 +- 2.8.1 +- 2.8.10 +- 2.8.2 +- 2.8.3 +- 2.8.4 +- 2.8.5 +- 2.8.6 +- 2.8.7 +- 2.8.8 +- 2.8.9 +- 2.9.0 +- 2.9.1 +- 2.9.2 +- 2.9.3 +- 2.9.4 +- 2.9.5 +- 2.9.6 diff --git a/awscli/tags.yaml b/awscli/tags.yaml new file mode 100644 index 0000000..33f313c --- /dev/null +++ b/awscli/tags.yaml @@ -0,0 +1,37 @@ +versions: +- 1.8.0 +- 1.8.1 +- 1.8.10 +- 1.8.11 +- 1.8.12 +- 1.8.13 +- 1.8.2 +- 1.8.3 +- 1.8.4 +- 1.8.5 +- 1.8.6 +- 1.8.7 +- 1.8.8 +- 1.8.9 +- 1.9.0 +- 1.9.1 +- 1.9.10 +- 1.9.11 +- 1.9.12 +- 1.9.13 +- 1.9.14 +- 1.9.15 +- 1.9.16 +- 1.9.17 +- 1.9.18 +- 1.9.19 +- 1.9.2 +- 1.9.20 +- 1.9.21 +- 1.9.3 +- 1.9.4 +- 1.9.5 +- 1.9.6 +- 1.9.7 +- 1.9.8 +- 1.9.9 diff --git a/awslogs/tags.yaml b/awslogs/tags.yaml new file mode 100644 index 0000000..ccf1cb5 --- /dev/null +++ b/awslogs/tags.yaml @@ -0,0 +1,3 @@ +versions: +- 0.7.0 +- 0.8.0 diff --git a/httpie/tags.yaml b/httpie/tags.yaml new file mode 100644 index 0000000..5e3253e --- /dev/null +++ b/httpie/tags.yaml @@ -0,0 +1,5 @@ +versions: +- 1.0.0 +- 1.0.2 +- 1.0.3 +- 2.0.0 diff --git a/jq/tags.yaml b/jq/tags.yaml new file mode 100644 index 0000000..18f97df --- /dev/null +++ b/jq/tags.yaml @@ -0,0 +1,3 @@ +versions: +- 1.5 +- 1.6 diff --git a/proselint/tags.yaml b/proselint/tags.yaml new file mode 100644 index 0000000..5b3c3da --- /dev/null +++ b/proselint/tags.yaml @@ -0,0 +1,3 @@ +versions: +- 0.8.0 +- 0.9.0 diff --git a/pygmentize/tags.yaml b/pygmentize/tags.yaml new file mode 100644 index 0000000..a436c8a --- /dev/null +++ b/pygmentize/tags.yaml @@ -0,0 +1,5 @@ +versions: +- 2.5.1 +- 2.5.2 +- 2.6.0 +- 2.6.1 diff --git a/youtube-dl/tags.yaml b/youtube-dl/tags.yaml new file mode 100644 index 0000000..fed7937 --- /dev/null +++ b/youtube-dl/tags.yaml @@ -0,0 +1,8 @@ +versions: +- 2020.1.1 +- 2020.1.15 +- 2020.1.24 +- 2020.2.16 +- 2020.3.1 +- 2020.3.6 +- 2020.3.8 diff --git a/yq/tags.yaml b/yq/tags.yaml new file mode 100644 index 0000000..c442545 --- /dev/null +++ b/yq/tags.yaml @@ -0,0 +1,4 @@ +versions: +- 2.8.0 +- 2.8.1 +- 2.9.2