File tree 2 files changed +61
-0
lines changed
2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 30
30
run : ' ./test/run.sh'
31
31
shell : ' bash'
32
32
33
+ - uses : ' docker/setup-buildx-action@v2'
34
+ if : contains(matrix.os, 'ubuntu')
35
+ with :
36
+ install : true
37
+ - uses : ' docker/build-push-action@v3'
38
+ if : contains(matrix.os, 'ubuntu')
39
+ with :
40
+ context : .
41
+ load : true
42
+ tags : " tfenv-terraform:${{ github.head_ref }}"
43
+ - name : ' Check Dockerfile'
44
+ if : contains(matrix.os, 'ubuntu')
45
+ run : |
46
+ expect=1.2.3;
47
+ got="$(docker run -e "TFENV_TERRAFORM_VERSION=${expect}" "tfenv-terraform:${{ github.head_ref }}" version)";
48
+ echo "${got}" | tee /dev/stderr | grep -e 'Terraform v1.2.3'
49
+
33
50
# When we push to master, test everything in order to guarantee releases
34
51
test-master-pushes :
35
52
if : github.event_name == 'push' && github.ref == 'refs/heads/master'
51
68
- name : ' Run all tests'
52
69
run : ' ./test/run.sh'
53
70
shell : ' bash'
71
+
72
+ - uses : ' docker/setup-buildx-action@v2'
73
+ if : contains(matrix.os, 'ubuntu')
74
+ with :
75
+ install : true
76
+ - uses : ' docker/build-push-action@v3'
77
+ if : contains(matrix.os, 'ubuntu')
78
+ with :
79
+ context : .
80
+ load : true
81
+ tags : ' tfenv-terraform:latest'
82
+ - name : ' Check Dockerfile'
83
+ if : contains(matrix.os, 'ubuntu')
84
+ run : |
85
+ expect=1.2.3;
86
+ got="$(docker run -e "TFENV_TERRAFORM_VERSION=${expect}" tfenv-terraform:latest version)";
87
+ echo "${got}" | tee /dev/stderr | grep -e 'Terraform v1.2.3'
Original file line number Diff line number Diff line change
1
+ ARG BASH_VERSION=5
2
+ FROM "docker.io/bash:${BASH_VERSION}"
3
+
4
+ # Runtime dependencies
5
+ RUN apk add --no-cache --purge \
6
+ curl \
7
+ ;
8
+
9
+ ARG TFENV_VERSION=3.0.0
10
+ RUN wget -O /tmp/tfenv.tar.gz "https://github.com/tfutils/tfenv/archive/refs/tags/v${TFENV_VERSION}.tar.gz" \
11
+ && tar -C /tmp -xf /tmp/tfenv.tar.gz \
12
+ && mv "/tmp/tfenv-${TFENV_VERSION}/bin" /* /usr/local/bin/ \
13
+ && mkdir -p /usr/local/lib/tfenv \
14
+ && mv "/tmp/tfenv-${TFENV_VERSION}/lib" /usr/local/lib/tfenv/ \
15
+ && mv "/tmp/tfenv-${TFENV_VERSION}/libexec" /usr/local/lib/tfenv/ \
16
+ && mkdir -p /usr/local/share/licenses \
17
+ && mv "/tmp/tfenv-${TFENV_VERSION}/LICENSE" /usr/local/share/licenses/tfenv \
18
+ && rm -rf /tmp/tfenv* \
19
+ ;
20
+ ENV TFENV_ROOT /usr/local/lib/tfenv
21
+
22
+ ENV TFENV_CONFIG_DIR /var/tfenv
23
+ VOLUME /var/tfenv
24
+
25
+ # Default to latest; user-specifiable
26
+ ENV TFENV_TERRAFORM_VERSION latest
27
+ ENTRYPOINT ["/usr/local/bin/terraform" ]
You can’t perform that action at this time.
0 commit comments