Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 977d879b08 |
@@ -2,9 +2,6 @@ name: Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -17,7 +14,7 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Packages
|
||||
- name: Install Terraform/Terragrunt
|
||||
run: |
|
||||
dnf install terraform terragrunt vault jq -y
|
||||
|
||||
@@ -25,15 +22,16 @@ jobs:
|
||||
env:
|
||||
VAULT_ROLEID: ${{ secrets.TERRAFORM_NOMAD_VAULT_ROLEID }}
|
||||
run: |
|
||||
env
|
||||
make plan
|
||||
|
||||
- name: Show Plans
|
||||
run: |
|
||||
find /workspace -type f -name "*.plan"
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: plans
|
||||
path: /workspace/unkin/terraform-nomad/plans/*.plan
|
||||
#- name: Upload Artifacts
|
||||
# uses: actions/upload-artifact@v3
|
||||
# with:
|
||||
# name: plans
|
||||
# path: /workspace/unkin/rpmbuilder/dist/*/*.rpm
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: almalinux-8
|
||||
container:
|
||||
image: git.query.consul/unkin/almalinux8-runnerdnd:latest
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download Build Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: plans
|
||||
path: /workspace/unkin/terraform-nomad/plans
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
dnf install terraform terragrunt vault jq -y
|
||||
|
||||
- name: Run Terraform Apply
|
||||
env:
|
||||
VAULT_ROLEID: ${{ secrets.TERRAFORM_NOMAD_VAULT_ROLEID }}
|
||||
run: |
|
||||
make apply
|
||||
@@ -20,14 +20,15 @@ clean:
|
||||
rm -rf plans
|
||||
|
||||
init:
|
||||
$(call vault_env) && \
|
||||
$(call vault_env)
|
||||
env | sort
|
||||
terragrunt --terragrunt-working-dir $(ENV_DIR) init
|
||||
|
||||
plan: init
|
||||
@mkdir -p $(PLAN_DIR)
|
||||
$(call vault_env) && \
|
||||
$(call vault_env)
|
||||
terragrunt --terragrunt-working-dir $(ENV_DIR) plan -out=$(PLAN_FILE)
|
||||
|
||||
apply:
|
||||
$(call vault_env) && \
|
||||
$(call vault_env)
|
||||
terragrunt --terragrunt-working-dir $(ENV_DIR) apply $(PLAN_FILE)
|
||||
|
||||
Reference in New Issue
Block a user