.gitlab-ci.yml 917 Bytes
Newer Older
Frederik Schwan's avatar
Frederik Schwan committed
1
2
3
image: "archlinux:latest"

before_script:
4
  - pacman -Syu --needed --noconfirm ansible-lint ansible yamllint terraform
Frederik Schwan's avatar
Frederik Schwan committed
5
6
7

ansible-lint:
  script:
8
    # Fix weird ansible bug: https://github.com/trailofbits/algo/issues/1637
9
    # This probably happens due to gitlab-runner mounting the git repo into the container
Frederik Schwan's avatar
Frederik Schwan committed
10
    - chmod o-w .
11
12
13
    # Fix syntax-check rule (https://github.com/ansible-community/ansible-lint/issues/1350#issuecomment-778764110)
    - sed "s/,hcloud_inventory.py//" -i ansible.cfg
    - sed "/^vault_password_file/d" -i ansible.cfg
Kristian Klausen's avatar
Kristian Klausen committed
14
15
    # Fix load-failure: Failed to load or parse file
    - ansible-lint $(printf -- "--exclude %s " */*/vault_*)
16
17
18
19
20
21

terraform-validate:
  script:
    - cd tf-stage1
    - terraform init -backend=false
    - terraform validate
22
    - terraform fmt --check
23
24
25
    - cd ../tf-stage2
    - terraform init -backend=false
    - terraform validate
26
    - terraform fmt --check --diff