75 lines
1.9 KiB
YAML
75 lines
1.9 KiB
YAML
---
|
|
kind: pipeline
|
|
type: kubernetes
|
|
name: Terraform root module
|
|
|
|
environment:
|
|
TF_IN_AUTOMATION: "1"
|
|
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no -i $${PWD}/id_rsa"
|
|
TF_VAR_lawndale_libvirt_uri_transport: ssh
|
|
TF_VAR_lawndale_libvirt_uri_userhostport: "192.168.253.254:10022"
|
|
|
|
trigger:
|
|
ref:
|
|
- refs/heads/main
|
|
- refs/pull/*/head
|
|
|
|
steps:
|
|
- name: terraform init
|
|
image: hashicorp/terraform:1.1.8
|
|
commands:
|
|
- echo "$${CI_SSH_KEY}" | base64 -d > id_rsa
|
|
- chmod 600 id_rsa
|
|
- echo 'lawndale_libvirt_uri_extra = {"sshauth"="privkey","keyfile"="'$${PWD}'/id_rsa","no_verify"="1"}' >> ci.tfvars
|
|
- terraform init
|
|
environment:
|
|
CI_SSH_KEY:
|
|
from_secret: ci-ssh-key
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: terraform-aws-key-id
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: terraform-aws-secret-access-key
|
|
|
|
- name: terraform plan
|
|
image: hashicorp/terraform:1.1.8
|
|
commands:
|
|
- terraform plan -var-file ci.tfvars -out .tfplan
|
|
environment:
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: terraform-aws-key-id
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: terraform-aws-secret-access-key
|
|
KUBE_TOKEN:
|
|
from_secret: lawndale-k8s-ci-token
|
|
TF_VAR_lawndale_dns_key_secret:
|
|
from_secret: lawndale-dns-key-secret
|
|
TF_VAR_lawndale_dns_key_algorithm:
|
|
from_secret: lawndale-dns-key-algorithm
|
|
|
|
- name: terraform apply
|
|
when:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
image: hashicorp/terraform:1.1.8
|
|
commands:
|
|
- terraform apply -var-file ci.tfvars .tfplan
|
|
environment:
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: terraform-aws-key-id
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: terraform-aws-secret-access-key
|
|
KUBE_TOKEN:
|
|
from_secret: lawndale-k8s-ci-token
|
|
TF_VAR_lawndale_dns_key_secret:
|
|
from_secret: lawndale-dns-key-secret
|
|
TF_VAR_lawndale_dns_key_algorithm:
|
|
from_secret: lawndale-dns-key-algorithm
|
|
|
|
---
|
|
kind: signature
|
|
hmac: 007cc7fc0dbdc2ae54a59dbc6c673e33e4f94831189eb3b6fd4b0b0f8adf703f
|
|
|
|
...
|