Skip to content
Snippets Groups Projects
.gitlab-ci.yml 977 B
Newer Older
  • Learn to ignore specific revisions
  • Frederik Schwan's avatar
    Frederik Schwan committed
    image: "archlinux:latest"
    
    ansible-lint:
    
      before_script:
        - pacman -Syu --needed --noconfirm ansible-lint ansible
    
    Frederik Schwan's avatar
    Frederik Schwan committed
      script:
    
        # Fix weird ansible bug: https://github.com/trailofbits/algo/issues/1637
    
        # This probably happens due to gitlab-runner mounting the git repo into the container
    
    Frederik Schwan's avatar
    Frederik Schwan committed
        - chmod o-w .
    
        # 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
    
        # Fix load-failure: Failed to load or parse file
        - ansible-lint $(printf -- "--exclude %s " */*/vault_*)
    
    
    terraform-validate:
    
      before_script:
        - pacman -Syu --needed --noconfirm terraform diffutils
    
      script:
        - cd tf-stage1
        - terraform init -backend=false
        - terraform validate
    
        - cd ../tf-stage2
        - terraform init -backend=false
        - terraform validate
    
        - terraform fmt --check --diff