Skip to content

Commit

Permalink
chore: repair aws cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Sierkin committed Jul 4, 2023
1 parent 9d63fe5 commit ca03a71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ That custom `atlantis` docker image was created in order to install few helpful
- `glab` (via asdf) - GitLab CLI client
- `az-cli` (via pip) - Azure CLI
- `Infracost` - cloud cost estimates
- `aws-cli` (via asdf) - AWS CLI
- `aws-cli` (via pip) - AWS CLI

Files found in the repo:
- `Dockerfile` is based on an official atlantis docker file (<https://github.com/runatlantis/atlantis/blob/v0.17.3/Dockerfile>) with some additional tweaks (asdf installation and configuration)
Expand Down
16 changes: 10 additions & 6 deletions app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ARG CHECKOV_VERSION=2.1.244
ARG INFRACOST_VERSION=v0.10.18
ARG TFLINT_VERSION=0.45.0
ARG TERRAFORM_DOCS_VERSION=0.16.0
ARG AWS_CLI_VERSION=2.12.6
ARG AWS_CLI_VERSION=1.28.0

RUN set -ex && \
apk update && \
Expand Down Expand Up @@ -49,6 +49,13 @@ RUN set -eux \
&& pip install azure-cli==${AZURE_CLI_VERSION} \
&& az --version

###
### Ensure AWS cli version is present and validated
###
RUN set -eux \
&& pip install awscli==${AWS_CLI_VERSION} \
&& aws --version

# Download and install Atlantis
RUN curl -LOs https://github.com/runatlantis/atlantis/releases/download/${ATLANTIS_VERSION}/atlantis_linux_amd64.zip && \
unzip atlantis_linux_amd64.zip -d /usr/bin && \
Expand Down Expand Up @@ -80,8 +87,7 @@ RUN gosu atlantis bash -l -c " \
asdf plugin-add gojq && \
asdf plugin-add tflint && \
asdf plugin-add terraform-docs && \
asdf plugin-add yq && \
asdf plugin add awscli"
asdf plugin-add yq"
# Install default versions and define them globally
RUN gosu atlantis bash -l -c " \
cd /home/atlantis/ && \
Expand All @@ -95,7 +101,6 @@ RUN gosu atlantis bash -l -c " \
asdf install tflint ${TFLINT_VERSION} && \
asdf install terraform-docs ${TERRAFORM_DOCS_VERSION} && \
asdf install yq ${YQ_VERSION} && \
asdf install awscli ${AWS_CLI_VERSION} && \
asdf global kubectl ${K8S_VERSION} && \
asdf global helm ${HELM_VERSION} && \
asdf global terraform ${TF_VERSION} && \
Expand All @@ -105,8 +110,7 @@ RUN gosu atlantis bash -l -c " \
asdf global gojq ${GOJQ_VERSION} && \
asdf global tflint ${TFLINT_VERSION} && \
asdf global terraform-docs ${TERRAFORM_DOCS_VERSION} && \
asdf global yq ${YQ_VERSION} && \
asdf global awscli ${AWS_CLI_VERSION}"
asdf global yq ${YQ_VERSION}"

# Additional cleanup
RUN rm -rf /tmp/*
Expand Down

0 comments on commit ca03a71

Please sign in to comment.