|
|
|
@ -43,123 +43,3 @@ steps:
|
|
|
|
|
- success
|
|
|
|
|
depends_on:
|
|
|
|
|
- docker build
|
|
|
|
|
---
|
|
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
name: terraform-plan
|
|
|
|
|
|
|
|
|
|
environment:
|
|
|
|
|
CONSUL_HTTP_ADDR: http://192.168.1.15:8500
|
|
|
|
|
NOMAD_ADDR: http://192.168.1.15:4646
|
|
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
|
branch:
|
|
|
|
|
exclude:
|
|
|
|
|
- trunk
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: terraform plan
|
|
|
|
|
image: hashicorp/terraform
|
|
|
|
|
commands:
|
|
|
|
|
- cd ./terraform/
|
|
|
|
|
- terraform init
|
|
|
|
|
- terraform providers
|
|
|
|
|
- terraform plan -refresh=true -lock-timeout=10s -lock=true -out=./terraform-ci.plan -var=consul_token=$${CONSUL_TOKEN} -var=vault_token=$${VAULT_TOKEN}
|
|
|
|
|
environment:
|
|
|
|
|
CONSUL_TOKEN:
|
|
|
|
|
from_secret: CONSUL_TOKEN
|
|
|
|
|
VAULT_TOKEN:
|
|
|
|
|
from_secret: VAULT_TOKEN
|
|
|
|
|
---
|
|
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
name: terraform
|
|
|
|
|
|
|
|
|
|
environment:
|
|
|
|
|
CONSUL_HTTP_ADDR: http://192.168.1.15:8500
|
|
|
|
|
NOMAD_ADDR: http://192.168.1.15:4646
|
|
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
|
branch:
|
|
|
|
|
- trunk
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: terraform deploy
|
|
|
|
|
image: hashicorp/terraform
|
|
|
|
|
commands:
|
|
|
|
|
- cd ./terraform/
|
|
|
|
|
- terraform init
|
|
|
|
|
- terraform providers
|
|
|
|
|
- terraform apply -lock=true -auto-approve -input=false -var=consul_token=$${CONSUL_TOKEN} -var=vault_token=$${VAULT_TOKEN}
|
|
|
|
|
environment:
|
|
|
|
|
CONSUL_TOKEN:
|
|
|
|
|
from_secret: CONSUL_TOKEN
|
|
|
|
|
VAULT_TOKEN:
|
|
|
|
|
from_secret: VAULT_TOKEN
|
|
|
|
|
when:
|
|
|
|
|
branch:
|
|
|
|
|
- trunk
|
|
|
|
|
|
|
|
|
|
- name: post update
|
|
|
|
|
image: plugins/matrix
|
|
|
|
|
settings:
|
|
|
|
|
homeserver: https://matrix.vdhsn.com
|
|
|
|
|
password:
|
|
|
|
|
from_secret: MATRIX_PASSWORD
|
|
|
|
|
roomid: UwldmBPwrgpoXYozVG:matrix.vdhsn.com
|
|
|
|
|
template: "Terraform deploy from {{ build.branch }} {{ build.status }}. See @ [{{ repo.Owner }}/{{ repo.Name }}#{{ truncate build.commit 8 }}]({{ build.link }}). Triggered by {{ build.author }}"
|
|
|
|
|
username:
|
|
|
|
|
from_secret: MATRIX_USER
|
|
|
|
|
failure: ignore
|
|
|
|
|
when:
|
|
|
|
|
status:
|
|
|
|
|
- failure
|
|
|
|
|
- success
|
|
|
|
|
depends_on:
|
|
|
|
|
- terraform deploy
|
|
|
|
|
---
|
|
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
name: nomad
|
|
|
|
|
|
|
|
|
|
environment:
|
|
|
|
|
CONSUL_HTTP_ADDR: http://192.168.1.15:8500
|
|
|
|
|
NOMAD_ADDR: http://192.168.1.15:4646
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: nomad validate
|
|
|
|
|
image: adamveld12/nomad:1.0.4
|
|
|
|
|
commands:
|
|
|
|
|
- cd ./jobs/
|
|
|
|
|
- ./validate.sh
|
|
|
|
|
|
|
|
|
|
- name: nomad deploy
|
|
|
|
|
image: adamveld12/nomad:1.0.4
|
|
|
|
|
when:
|
|
|
|
|
event:
|
|
|
|
|
- push
|
|
|
|
|
branch:
|
|
|
|
|
- trunk
|
|
|
|
|
depends_on:
|
|
|
|
|
- nomad validate
|
|
|
|
|
commands:
|
|
|
|
|
- cd ./jobs/
|
|
|
|
|
- ./deploy.sh
|
|
|
|
|
|
|
|
|
|
- name: post update
|
|
|
|
|
image: plugins/matrix
|
|
|
|
|
settings:
|
|
|
|
|
homeserver: https://matrix.vdhsn.com
|
|
|
|
|
password:
|
|
|
|
|
from_secret: MATRIX_PASSWORD
|
|
|
|
|
roomid: UwldmBPwrgpoXYozVG:matrix.vdhsn.com
|
|
|
|
|
template: "Nomad deploy from {{ build.branch }} {{ build.status }}. See @ [{{ repo.Owner }}/{{ repo.Name }}#{{ truncate build.commit 8 }}]({{ build.link }}). Triggered by {{ build.author }}"
|
|
|
|
|
username:
|
|
|
|
|
from_secret: MATRIX_USER
|
|
|
|
|
failure: ignore
|
|
|
|
|
when:
|
|
|
|
|
status:
|
|
|
|
|
- failure
|
|
|
|
|
- success
|
|
|
|
|
depends_on:
|
|
|
|
|
- nomad deploy
|
|
|
|
|