Commit ee9bf6b9 authored by Michal Wasilewski's avatar Michal Wasilewski

switch to using prebuilt docker image

parent 1d2a933b
image: "alpine:latest"
image: "registry.gitlab.com/gitlab-com/gl-infra/ci-images/gitlab-com-infrastructure:latest"
stages:
- format
......@@ -7,21 +7,14 @@ stages:
- deployment
before_script:
- apk add --no-cache bash build-base ca-certificates curl git gnupg make openssh-client ruby ruby-dev unzip && update-ca-certificates
- gem install --no-rdoc --no-ri terraform_landscape json multi_json
- git clone https://github.com/tfutils/tfenv.git /.tfenv
- export PATH=/.tfenv/bin:$PATH
- for version in $(find . -name .terraform-version |xargs cat |sort -u); do /.tfenv/bin/tfenv install ${version}; done
# Terraform requires a key file for TF_VAR_ssh_key. We don't really use it
# but it has to be there.
- echo "This is not a real key" > /fake_user_key
- curl -sLO https://github.com/wata727/tflint/releases/download/v0.7.3/tflint_linux_amd64.zip && unzip tflint_linux_amd64.zip && mv tflint /bin
tf_format:
stage: format
script: |
#!/bin/sh
set +o pipefail
echo "running tf format" # there's no output for empty builds otherwise
fmt_diff=$(git diff-tree --no-commit-id --name-only -r ${CI_COMMIT_SHA} | grep '\.tf$' | xargs -I{} terraform fmt -write=false {} | sed '/^\s*$/d')
if test -n "$fmt_diff"; then
echo "******* Terraform formatting error:"
......@@ -41,6 +34,7 @@ tf_validate:
script: |
#!/bin/sh
set +o pipefail
echo "running tf validate" # there's no output for empty builds otherwise
# SSH setup for module cloning
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | base64 -d | tr -d '\r' | ssh-add - > /dev/null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment