summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/templates/Packer.gitlab-ci.yml
blob: 0a3cf3dcf77e1aa201780d2f72eaeb7b89527387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
image:
  name: hashicorp/packer:latest
  entrypoint:
    - '/usr/bin/env'
    - 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

before_script:
  - packer --version

stages:
  - validate
  - build
  - test
  - deploy

validate:
  stage: validate
  script:
    - find . -maxdepth 1 -name '*.json' -print0 | xargs -t0n1 packer validate

build:
  stage: deploy
  environment: production
  script:
    - find . -maxdepth 1 -name '*.json' -print0 | xargs -t0n1 packer build
  when: manual
  only:
    - master