27 lines
823 B
YAML
27 lines
823 B
YAML
version: 3
|
|
env: { TF: terraform -chdir=terraform }
|
|
silent: true
|
|
|
|
tasks:
|
|
tf/init: $TF init -backend-config=backend.tfvars
|
|
tf/plan: $TF plan -var-file=secret.tfvars
|
|
tf/destroy: $TF destroy
|
|
tf/format: $TF fmt -recursive
|
|
tf/apply:
|
|
- $TF apply -var-file=secret.tfvars
|
|
- $TF output -json > secrets.tf.json
|
|
|
|
build: ansible-playbook playbooks/build.yml
|
|
deploy: ansible-playbook playbooks/deploy.yml
|
|
run:
|
|
- task: build
|
|
- task: deploy
|
|
|
|
enter:
|
|
cmd: aws ssm start-session --target $INSTANCE_ID
|
|
env:
|
|
INSTANCE_ID: { sh: jq -r .instance_id.value < secrets.tf.json }
|
|
AWS_REGION: { sh: jq -r .aws_region < secrets/gitea.json }
|
|
AWS_ACCESS_KEY_ID: { sh: jq -r .aws_access_key < secrets/gitea.json }
|
|
AWS_SECRET_ACCESS_KEY: { sh: jq -r .aws_secret_key < secrets/gitea.json }
|