2022-04-25 22:30:25 +02:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Apply Cloud infra changes
|
|
|
|
|
|
|
|
steps:
|
2022-04-25 22:31:15 +02:00
|
|
|
- name: Initialite Terraform resources
|
2022-04-25 23:24:29 +02:00
|
|
|
environment:
|
|
|
|
ARM_CLIENT_ID:
|
|
|
|
from_secret: ARM_CLIENT_ID
|
|
|
|
ARM_CLIENT_SECRET:
|
|
|
|
from_secret: ARM_CLIENT_SECRET
|
|
|
|
ARM_SUBSCRIPTION_ID:
|
|
|
|
from_secret: ARM_SUBSCRIPTION_ID
|
|
|
|
ARM_TENANT_ID:
|
|
|
|
from_secret: ARM_TENANT_ID
|
|
|
|
CLOUDFLARE_EMAIL:
|
|
|
|
from_secret: CLOUDFLARE_EMAIL
|
|
|
|
CLOUDFLARE_API_TOKEN:
|
|
|
|
from_secret: CLOUDFLARE_API_TOKEN
|
|
|
|
ARTIFACTORY_USERNAME:
|
|
|
|
from_secret: ARTIFACTORY_USERNAME
|
|
|
|
ARTIFACTORY_PASSWORD:
|
|
|
|
from_secret: ARTIFACTORY_PASSWORD
|
|
|
|
ARTIFACTORY_URL:
|
|
|
|
from_secret: ARTIFACTORY_URL
|
2022-04-25 22:31:15 +02:00
|
|
|
image: hashicorp/terraform
|
|
|
|
commands:
|
|
|
|
- terraform init
|
|
|
|
|
2022-04-25 22:30:25 +02:00
|
|
|
- name: Validate Terraform configuration
|
2022-04-25 23:25:18 +02:00
|
|
|
environment:
|
|
|
|
ARM_CLIENT_ID:
|
|
|
|
from_secret: ARM_CLIENT_ID
|
|
|
|
ARM_CLIENT_SECRET:
|
|
|
|
from_secret: ARM_CLIENT_SECRET
|
|
|
|
ARM_SUBSCRIPTION_ID:
|
|
|
|
from_secret: ARM_SUBSCRIPTION_ID
|
|
|
|
ARM_TENANT_ID:
|
|
|
|
from_secret: ARM_TENANT_ID
|
|
|
|
CLOUDFLARE_EMAIL:
|
|
|
|
from_secret: CLOUDFLARE_EMAIL
|
|
|
|
CLOUDFLARE_API_TOKEN:
|
|
|
|
from_secret: CLOUDFLARE_API_TOKEN
|
|
|
|
ARTIFACTORY_USERNAME:
|
|
|
|
from_secret: ARTIFACTORY_USERNAME
|
|
|
|
ARTIFACTORY_PASSWORD:
|
|
|
|
from_secret: ARTIFACTORY_PASSWORD
|
|
|
|
ARTIFACTORY_URL:
|
|
|
|
from_secret: ARTIFACTORY_URL
|
2022-04-25 22:30:25 +02:00
|
|
|
image: hashicorp/terraform
|
|
|
|
commands:
|
|
|
|
- terraform validate
|
|
|
|
|
|
|
|
- name: Check state changes in infrastructure
|
2022-04-25 23:25:18 +02:00
|
|
|
environment:
|
|
|
|
ARM_CLIENT_ID:
|
|
|
|
from_secret: ARM_CLIENT_ID
|
|
|
|
ARM_CLIENT_SECRET:
|
|
|
|
from_secret: ARM_CLIENT_SECRET
|
|
|
|
ARM_SUBSCRIPTION_ID:
|
|
|
|
from_secret: ARM_SUBSCRIPTION_ID
|
|
|
|
ARM_TENANT_ID:
|
|
|
|
from_secret: ARM_TENANT_ID
|
|
|
|
CLOUDFLARE_EMAIL:
|
|
|
|
from_secret: CLOUDFLARE_EMAIL
|
|
|
|
CLOUDFLARE_API_TOKEN:
|
|
|
|
from_secret: CLOUDFLARE_API_TOKEN
|
|
|
|
ARTIFACTORY_USERNAME:
|
|
|
|
from_secret: ARTIFACTORY_USERNAME
|
|
|
|
ARTIFACTORY_PASSWORD:
|
|
|
|
from_secret: ARTIFACTORY_PASSWORD
|
|
|
|
ARTIFACTORY_URL:
|
|
|
|
from_secret: ARTIFACTORY_URL
|
2022-04-25 22:30:25 +02:00
|
|
|
image: hashicorp/terraform
|
|
|
|
commands:
|
|
|
|
- terraform plan
|
|
|
|
|
|
|
|
- name: Apply changes
|
2022-04-25 23:25:18 +02:00
|
|
|
|
|
|
|
environment:
|
|
|
|
ARM_CLIENT_ID:
|
|
|
|
from_secret: ARM_CLIENT_ID
|
|
|
|
ARM_CLIENT_SECRET:
|
|
|
|
from_secret: ARM_CLIENT_SECRET
|
|
|
|
ARM_SUBSCRIPTION_ID:
|
|
|
|
from_secret: ARM_SUBSCRIPTION_ID
|
|
|
|
ARM_TENANT_ID:
|
|
|
|
from_secret: ARM_TENANT_ID
|
|
|
|
CLOUDFLARE_EMAIL:
|
|
|
|
from_secret: CLOUDFLARE_EMAIL
|
|
|
|
CLOUDFLARE_API_TOKEN:
|
|
|
|
from_secret: CLOUDFLARE_API_TOKEN
|
|
|
|
ARTIFACTORY_USERNAME:
|
|
|
|
from_secret: ARTIFACTORY_USERNAME
|
|
|
|
ARTIFACTORY_PASSWORD:
|
|
|
|
from_secret: ARTIFACTORY_PASSWORD
|
|
|
|
ARTIFACTORY_URL:
|
|
|
|
from_secret: ARTIFACTORY_URL
|
2022-04-25 22:30:25 +02:00
|
|
|
image: hashicorp/terraform
|
|
|
|
commands:
|
|
|
|
- terraform apply -auto-approve
|