Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for GH actions runner changes #242

Merged
merged 4 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow Code: IrritableEagle_v32 DO NOT REMOVE
# Workflow Code: IrritableEagle_v33 DO NOT REMOVE
# Purpose:
# Automatically runs a terraform apply -auto-approve with the changes
# in the PR against the dev environment when a PR is merged to main.
Expand Down Expand Up @@ -74,7 +74,19 @@ jobs:
uses: im-open/[email protected]
with:
deploy-key-info: ${{ env.SSH_DEPLOY_KEY_INFO }}


- name: Install SqlServer Module
shell: pwsh
run: |
Install-Module -Name SqlServer -Force

- name: AZ Login
uses: azure/login@v1
with:
tenant-id: ${{ vars.ARM_TENANT_ID }}
subscription-id: ${{ vars.ARM_SUBSCRIPTION_ID }}
client-id: ${{ vars.ARM_CLIENT_ID }}

- name: Setup Terraform
id: setup
uses: hashicorp/[email protected]
Expand Down
19 changes: 11 additions & 8 deletions workflow-templates/im-deploy-tf-manual-apply.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow Code: InsaneHamster_v44 DO NOT REMOVE
# Workflow Code: InsaneHamster_v45 DO NOT REMOVE
# Purpose:
# Deploys the terraform from a specified root module at a
# specified when someone kicks off the workflow manually.
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
# production-environments: 'prod,prod-secondary' # TODO: Adjust and include the production-environments if necessary (some apps may need to add stage/stage-secondary to this list)
# default-branch: main # TODO: Update and include this arg if the default branch is not main
# workflow-summary : | # TODO: If desired, the workflow summary that is generated can be overridden by providing this custom value.

set-vars:
needs: [setup-deployment-workflow]
runs-on: ubuntu-latest # Force this to run on github-hosted runner by using a tag that does not exist on self-hosted runners
Expand Down Expand Up @@ -236,7 +236,7 @@ jobs:

plan_results=$(echo "$plan" | grep -e "Plan:" -e "No changes." -e "# module.") # TODO: Add any unique filters required in your pipeline. IE terraform-f5 output doesn't have module. prefix.
echo "Plan Results Returned:"
echo "$plan_results "
echo "$plan_results "
if [[ -z "$plan_results" ]]; then
plan_results="Errors were found in terraform plan"
fi
Expand All @@ -263,7 +263,7 @@ jobs:
echo "current directory:"
ls -R

echo "Uploading tf plan to azure storage account ${{ needs.set-vars.outputs.STORAGE_ACCOUNT }}"
echo "Uploading tf plan to azure storage account ${{ needs.set-vars.outputs.STORAGE_ACCOUNT }}"
az storage blob upload --no-progress --auth-mode login --account-name ${{ needs.set-vars.outputs.STORAGE_ACCOUNT }} --container-name ${{ env.PLAN_STORAGE_CONTAINER }} --file $terraformPlanName --name $terraformBlobName
echo "The plan was successfully uploaded"

Expand Down Expand Up @@ -307,12 +307,15 @@ jobs:
with:
deploy-key-info: ${{ env.SSH_DEPLOY_KEY_INFO }}

- name: Install SqlServer Module
shell: pwsh
run: |
Install-Module -Name SqlServer -Force

- name: AZ Login
uses: azure/login@v1
with:
# This is an org-level variable
tenant-id: ${{ vars.ARM_TENANT_ID }}
# These are env-level variables
subscription-id: ${{ vars.ARM_SUBSCRIPTION_ID }}
client-id: ${{ vars.ARM_CLIENT_ID }}

Expand Down Expand Up @@ -409,7 +412,7 @@ jobs:
uses: im-practices/.github/.github/workflows/im-reusable-finish-deployment-workflow.yml@v2
with:
# Required Inputs
deployment-environment: ${{ inputs.root-module }} # The environment/target that was deployed to (dev, qa, stage, stage-secondary, uat, demo, prod, prod-secondary)
deployment-environment: ${{ inputs.root-module }} # The environment/target that was deployed to (dev, qa, stage, stage-secondary, uat, demo, prod, prod-secondary)
gh-secrets-environment: ${{ needs.set-vars.outputs.GITHUB_SECRETS_ENVIRONMENT }} # The GitHub environment that secrets are pulled from
release-tag: ${{ inputs.branch-tag-sha }}
title-of-teams-post: 'Deploy <<PROJECT_NAME>> @${{ inputs.branch-tag-sha }} to ${{ inputs.root-module }}' # TODO: Replace <<PROJECT_NAME>> and verify title to ensure it is descriptive/readable.
Expand All @@ -434,4 +437,4 @@ jobs:
# ]
secrets:
MS_TEAMS_URI: ${{ vars.MS_TEAMS_URI }}
DEPLOY_NOTIFICATIONS_CHANNEL: ${{ vars.DEPLOY_NOTIFICATIONS_CHANNEL }}
DEPLOY_NOTIFICATIONS_CHANNEL: ${{ vars.DEPLOY_NOTIFICATIONS_CHANNEL }}