Skip to content

Commit 6c14906

Browse files
bgauduchpyaillet
andauthored
⬆️ Simplify release workflow, rework image tagging strategy and prepare TF 0.13 beta 3 release (#34)
* ⬆️ updated default tf and aws cli versions * 👷 simplify release workflow, added support for TF 0.13 beta3 * 📝 updated image tag documentation * ✏️ update included tools doc * ✨ review by pyaillet Co-authored-by: Pierre-Yves Aillet <[email protected]> Co-authored-by: Pierre-Yves Aillet <[email protected]>
1 parent ec3101e commit 6c14906

File tree

4 files changed

+27
-31
lines changed

4 files changed

+27
-31
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
release:
66
types: [published]
77

8-
env:
9-
ORGANIZATION: "zenika"
10-
IMAGE_NAME: "terraform-aws-cli"
11-
128
jobs:
139
lint:
1410
runs-on: ubuntu-latest
@@ -28,40 +24,40 @@ jobs:
2824

2925
strategy:
3026
matrix:
31-
versions:
32-
- { tf_version: "0.11.14", awscli_version: "1.18.85" }
33-
- { tf_version: "0.12.26", awscli_version: "1.18.85" }
34-
- { tf_version: "0.13.0-beta2", awscli_version: "1.18.85" }
27+
tf_version:
28+
- "0.11.14"
29+
- "0.12.28"
30+
- "0.13.0-beta3"
3531

3632
env:
37-
TF_VERSION: ${{ matrix.versions.tf_version }}
38-
AWS_CLI_VERSIOIN: ${{ matrix.versions.awscli_version }}
39-
IMAGE_TAG: "tf${{ matrix.versions.tf_version }}-awscli${{ matrix.versions.awscli_version }}"
33+
ORGANIZATION: "zenika"
34+
IMAGE_NAME: "terraform-aws-cli"
35+
AWS_CLI_VERSION: "1.18.93"
4036

4137
steps:
4238
- name: Check out the repo
4339
uses: actions/checkout@v2
4440

45-
- name: Get and save release tag
41+
- name: Get and save the release tag
4642
run: echo "::set-env name=RELEASE_TAG::${GITHUB_REF##*/}"
4743

48-
- name: Build and save image release tag
49-
run: echo "::set-env name=IMAGE_RELEASE_TAG::r${RELEASE_TAG}-${IMAGE_TAG}"
44+
- name: Build and save the image release tag
45+
run: echo "::set-env name=IMAGE_TAG::release-${RELEASE_TAG}_terraform-${{ matrix.tf_version }}_awscli-${AWS_CLI_VERSION}"
5046

5147
- name: Build image
52-
run: docker image build . --file Dockerfile --build-arg TERRAFORM_VERSION=$TF_VERSION --build-arg AWS_CLI_VERSION=$AWS_CLI_VERSIOIN --tag $ORGANIZATION/$IMAGE_NAME:$IMAGE_RELEASE_TAG
48+
run: docker image build . --file Dockerfile --build-arg TERRAFORM_VERSION=${{ matrix.tf_version }} --build-arg AWS_CLI_VERSION=${AWS_CLI_VERSION} --tag ${ORGANIZATION}/${IMAGE_NAME}:${IMAGE_TAG}
5349

5450
- name: Login to Docker Hub registry
5551
run: echo '${{ secrets.DOCKERHUB_PASS }}' | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
5652

5753
- name: Push image to registry
58-
run: docker push $ORGANIZATION/$IMAGE_NAME:$IMAGE_RELEASE_TAG
54+
run: docker push ${ORGANIZATION}/${IMAGE_NAME}:${IMAGE_TAG}
5955

6056
- name: Save image
61-
run: docker image save -o $IMAGE_NAME-$IMAGE_RELEASE_TAG.tar $ORGANIZATION/$IMAGE_NAME:$IMAGE_RELEASE_TAG
57+
run: docker image save -o ${IMAGE_NAME}-${IMAGE_TAG}.tar ${ORGANIZATION}/${IMAGE_NAME}:${IMAGE_TAG}
6258

6359
- name: Upload image artifact
6460
uses: actions/upload-artifact@v2
6561
with:
66-
name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_RELEASE_TAG }}
67-
path: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_RELEASE_TAG }}.tar
62+
name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}
63+
path: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}.tar

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Setup build arguments with default versions
2-
ARG AWS_CLI_VERSION=1.18.85
3-
ARG TERRAFORM_VERSION=0.12.26
2+
ARG AWS_CLI_VERSION=1.18.93
3+
ARG TERRAFORM_VERSION=0.12.28
44
ARG PYTHON_MAJOR_VERSION=3.7
55
ARG DEBIAN_VERSION=buster-20200514-slim
66

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Available image tags can be found on the Docker Hub registry: [zenika/terraform-
1313
The following image tag strategy is applied:
1414
* `zenika/terraform-aws-cli:latest` - build from master
1515
* Included CLI versions can be found in the [Dockerfile](https://github.com/Zenika/terraform-aws-cli/blob/master/Dockerfile)
16-
* `zenika/terraform-aws-cli:rS.T-tfUU.VV.WW-awscliXX.YY.ZZ` - build from releases
17-
* `rS.T` is the release tag
18-
* `tfUU.VV.WWW` is the Terraform version included in the image
19-
* `awscliXX.YY.ZZ` is the AWS CLI version included in the image
16+
* `zenika/terraform-aws-cli:release-S.T_terraform-UU.VV.WW_awscli-XX.YY.ZZ` - build from releases
17+
* `release-S.T` is the release tag
18+
* `terraform-UU.VV.WWW` is the Terraform version included in the image
19+
* `awscli-XX.YY.ZZ` is the AWS CLI version included in the image
2020

2121
Please report to the [releases page](https://github.com/Zenika/terraform-aws-cli/releases) for the changelogs. Any other tags are not supported.
2222

@@ -29,10 +29,10 @@ This image gives you the flexibility to be used for development or as a base ima
2929
Tools included:
3030

3131
* [AWS CLI](https://aws.amazon.com/fr/cli/)
32-
* Included version indicated in the image tag: `awscliXX.YY.ZZ`
32+
* Included version indicated in the image tag: `awscli-XX.YY.ZZ`
3333
* See available version on the [pip repository](https://pypi.org/project/awscli/#history)
3434
* [Terraform CLI](https://www.terraform.io/docs/commands/index.html)
35-
* Included version indicated in the image tag: `tfXX.YY.ZZ`
35+
* Included version indicated in the image tag: `terraform-XX.YY.ZZ`
3636
* See available versions on the [project release page](https://github.com/hashicorp/terraform/releases)
3737
* [Git](https://git-scm.com/) for Terraform remote module usage, see available versions on the [Debian Packages repository](https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=git)
3838
* [jq](https://stedolan.github.io/jq/) to process JSON returned by AWS, see available versions on the [Debian Packages repository](https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=jq)
@@ -71,8 +71,8 @@ Optionally, it is possible to choose the tools desired versions using [Docker bu
7171
7272
```bash
7373
# Set tools desired versions
74-
AWS_CLI_VERSION=1.18.85
75-
TERRAFORM_VERSION=0.12.26
74+
AWS_CLI_VERSION=1.18.93
75+
TERRAFORM_VERSION=0.12.28
7676

7777
# launch the build script with parameters
7878
./dev-build.sh $AWS_CLI_VERSION $TERRAFORM_VERSION

tests/container-structure-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ commandTests:
2626
- name: "Check Terraform CLI version"
2727
command: "terraform"
2828
args: ["version"]
29-
expectedOutput: ["Terraform v0.12.26"]
29+
expectedOutput: ["Terraform v0.12.28"]
3030

3131
- name: "Check AWS CLI version"
3232
command: "aws"
3333
args: ["--version"]
34-
expectedOutput: ["aws-cli/1.18.85"]
34+
expectedOutput: ["aws-cli/1.18.93"]

0 commit comments

Comments
 (0)