From 7a6eb546585d64841238dfaec5548244e22c75bf Mon Sep 17 00:00:00 2001 From: Enol Fernandez Date: Thu, 2 Dec 2021 15:39:59 +0000 Subject: [PATCH] Move all deployment stuff to a subdir --- .github/workflows/deploy.yaml | 7 +++++++ cloud-init.yaml => deployment/cloud-init.yaml | 0 clouds.tf => deployment/clouds.tf | 0 config.yaml => deployment/config.yaml | 0 configure.sh => deployment/configure.sh | 0 deploy.tfvars => deployment/deploy.tfvars | 0 .../galaxy-requirements.yaml | 0 main.tf => deployment/main.tf | 0 playbook.yaml => deployment/playbook.yaml | 0 site-config.sh => deployment/site-config.sh | 0 vars.tf => deployment/vars.tf | 0 versions.tf => deployment/versions.tf | 0 12 files changed, 7 insertions(+) rename cloud-init.yaml => deployment/cloud-init.yaml (100%) rename clouds.tf => deployment/clouds.tf (100%) rename config.yaml => deployment/config.yaml (100%) rename configure.sh => deployment/configure.sh (100%) rename deploy.tfvars => deployment/deploy.tfvars (100%) rename galaxy-requirements.yaml => deployment/galaxy-requirements.yaml (100%) rename main.tf => deployment/main.tf (100%) rename playbook.yaml => deployment/playbook.yaml (100%) rename site-config.sh => deployment/site-config.sh (100%) rename vars.tf => deployment/vars.tf (100%) rename versions.tf => deployment/versions.tf (100%) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b26b58f..e52a1e4 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -30,21 +30,25 @@ jobs: MYTOKEN: ${{ secrets.MYTOKEN }} run: | PATH="$PWD:$PATH" + cd deployment ./site-config.sh - name: Setup Terraform uses: hashicorp/setup-terraform@v1 - name: Terraform Format id: fmt run: | + cd deployment terraform fmt -check - name: Terraform init id: init run: | + cd deployment terraform init - name: terraform plan id: plan if: github.event_name == 'pull_request' run: | + cd deployment terraform plan -no-color -var-file=deploy.tfvars continue-on-error: true - name: Update Pull Request @@ -79,11 +83,13 @@ jobs: - name: Terraform Apply if: github.ref == 'refs/heads/main' && github.event_name == 'push' run: | + cd deployment terraform apply -auto-approve -var-file=deploy.tfvars - name: Get IP id: public_ip if: github.ref == 'refs/heads/main' && github.event_name == 'push' run: | + cd deployment terraform output -raw public_ip - name: Update IP in DNS if: github.ref == 'refs/heads/main' && github.event_name == 'push' @@ -97,4 +103,5 @@ jobs: env: SSH_KEY: ${{ secrets.SSH_KEY }} run: | + cd deployment ./configure.sh "$SSH_KEY" "${{ steps.public_ip.outputs.stdout }}" diff --git a/cloud-init.yaml b/deployment/cloud-init.yaml similarity index 100% rename from cloud-init.yaml rename to deployment/cloud-init.yaml diff --git a/clouds.tf b/deployment/clouds.tf similarity index 100% rename from clouds.tf rename to deployment/clouds.tf diff --git a/config.yaml b/deployment/config.yaml similarity index 100% rename from config.yaml rename to deployment/config.yaml diff --git a/configure.sh b/deployment/configure.sh similarity index 100% rename from configure.sh rename to deployment/configure.sh diff --git a/deploy.tfvars b/deployment/deploy.tfvars similarity index 100% rename from deploy.tfvars rename to deployment/deploy.tfvars diff --git a/galaxy-requirements.yaml b/deployment/galaxy-requirements.yaml similarity index 100% rename from galaxy-requirements.yaml rename to deployment/galaxy-requirements.yaml diff --git a/main.tf b/deployment/main.tf similarity index 100% rename from main.tf rename to deployment/main.tf diff --git a/playbook.yaml b/deployment/playbook.yaml similarity index 100% rename from playbook.yaml rename to deployment/playbook.yaml diff --git a/site-config.sh b/deployment/site-config.sh similarity index 100% rename from site-config.sh rename to deployment/site-config.sh diff --git a/vars.tf b/deployment/vars.tf similarity index 100% rename from vars.tf rename to deployment/vars.tf diff --git a/versions.tf b/deployment/versions.tf similarity index 100% rename from versions.tf rename to deployment/versions.tf