24 lines
869 B
YAML
24 lines
869 B
YAML
kind: pipeline
|
|
name: Serverctl
|
|
|
|
steps:
|
|
- name: terraform plan
|
|
image: alpine
|
|
environment:
|
|
HCLOUD_TOKEN:
|
|
from_secret: serverctl_hcloud_token
|
|
ACCESS_KEY:
|
|
from_secret: serverctl_access_key
|
|
SECRET_KEY:
|
|
from_secret: serverctl_secret_key
|
|
commands:
|
|
- apk --update add curl
|
|
- curl --silent --output terraform.zip "https://releases.hashicorp.com/terraform/1.1.6/terraform_1.1.6_linux_amd64.zip"
|
|
- unzip terraform.zip ; rm -f terraform.zip; chmod +x terraform
|
|
- mkdir -p ${HOME}/bin ; export PATH=${PATH}:${HOME}/bin; mv terraform ${HOME}/bin/
|
|
- terraform -v
|
|
- cd infrastructure/create-resources
|
|
- terraform init -backend-config="access_key=$ACCESS_KEY" -backend-config="secret_key=$SECRET_KEY"
|
|
- terraform validate
|
|
- terraform apply -vars="hcloud_token=$HCLOUD_TOKEN"
|