2020-08-27 01:36:47 +02:00

45 lines
1.0 KiB
YAML

image: alpine:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- test
- build
- deploy
auto_update:
image: claranet/terraform-ci:0.13.1
stage: test
script:
- ./scripts/auto_update.sh
- git status
- git diff --exit-code
tags:
- ops4ops-claranet
deploy_terraform:
stage: deploy
script:
- apk update
- apk add --no-cache curl
- "curl -X POST -F token=${TEMPLATES_GITLAB_TOKEN} -F ref=${TEMPLATES_GITLAB_BRANCH:-master} -F \"variables[SCENARIO]=test\" ${CI_API_V4_URL}/projects/${TEMPLATES_GITLAB_ID}/trigger/pipeline"
only:
- master
tags:
- ops4ops-claranet
build_template:
stage: build
script:
- apk update
- apk add --no-cache curl
- "curl -X POST -F token=${TEMPLATES_GITLAB_TOKEN} -F ref=${TEMPLATES_GITLAB_BRANCH:-master} -F \"variables[SCENARIO]=build\" -F \"variables[TAG]=$CI_COMMIT_TAG\" ${CI_API_V4_URL}/projects/${TEMPLATES_GITLAB_ID}/trigger/pipeline"
only:
- tags
except:
- branches
tags:
- ops4ops-claranet