-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from PerfectThymeTech/marvinbuss/update_runners
Update workflows
- Loading branch information
Showing
7 changed files
with
58 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,15 @@ on: | |
required: true | ||
type: string | ||
description: "Specifies the working directory." | ||
export_terraform_outputs: | ||
required: false | ||
type: boolean | ||
default: false | ||
description: "Specifies whether terraform outputs should be exported." | ||
subscription_id: | ||
required: true | ||
type: string | ||
description: "Specifies the Azure subscription id." | ||
secrets: | ||
TENANT_ID: | ||
required: true | ||
|
@@ -22,42 +31,15 @@ on: | |
CLIENT_SECRET: | ||
required: true | ||
description: "Specifies the client secret." | ||
SUBSCRIPTION_ID: | ||
required: true | ||
description: "Specifies the client id." | ||
PAT: | ||
required: true | ||
description: "Specifies the GitHub PAT." | ||
DNS_API_PASSWORD: | ||
required: true | ||
description: "Specifies the API Password for DNS entries." | ||
outputs: | ||
mgmt_synapse_workspace_resource_group_name: | ||
description: "The resource group name of the management synapse workspace." | ||
value: ${{ jobs.apply.outputs.mgmt_synapse_workspace_resource_group_name }} | ||
mgmt_synapse_workspace_name: | ||
description: "The name of the management synapse workspace." | ||
value: ${{ jobs.apply.outputs.mgmt_synapse_workspace_name }} | ||
mgmt_synapse_workspace_sql_pool_name: | ||
description: "The name of the management synapse workspace SQL Pool." | ||
value: ${{ jobs.apply.outputs.mgmt_synapse_workspace_sql_pool_name }} | ||
mgmt_synapse_workspace_uri_sql: | ||
description: "The uri of the management synapse workspace." | ||
value: ${{ jobs.apply.outputs.mgmt_synapse_workspace_uri_sql }} | ||
mgmt_details: | ||
description: "Specifies the mgmt details for the SQL deployment." | ||
value: ${{ jobs.apply.outputs.mgmt_details }} | ||
core_details: | ||
description: "Specifies the core details for the SQL deployment." | ||
value: ${{ jobs.apply.outputs.core_details }} | ||
extension_details: | ||
description: "Specifies the extension details for the SQL deployment." | ||
value: ${{ jobs.apply.outputs.extension_details }} | ||
test: | ||
description: "A sample value." | ||
value: ${{ jobs.apply.outputs.test }} | ||
|
||
jobs: | ||
lint: | ||
name: Terraform Lint | ||
runs-on: [self-hosted, linux, original] | ||
runs-on: [self-hosted] | ||
continue-on-error: false | ||
needs: [] | ||
|
||
|
@@ -76,14 +58,14 @@ jobs: | |
plan: | ||
name: Terraform Plan | ||
runs-on: [self-hosted, linux, original] | ||
runs-on: [self-hosted] | ||
continue-on-error: false | ||
environment: ${{ inputs.environment }} | ||
needs: [lint] | ||
|
||
env: | ||
ARM_TENANT_ID: ${{ secrets.TENANT_ID }} | ||
ARM_SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }} | ||
ARM_SUBSCRIPTION_ID: ${{ inputs.subscription_id }} | ||
ARM_CLIENT_ID: ${{ secrets.CLIENT_ID }} | ||
ARM_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | ||
ARM_USE_OIDC: false | ||
|
@@ -99,11 +81,7 @@ jobs: | |
id: terraform_init | ||
working-directory: ${{ inputs.working_directory }} | ||
run: | | ||
export HOME=$(pwd -P) | ||
git config --global url."https://[email protected]".insteadOf https://github.developer.allianz.io | ||
terraform init | ||
env: | ||
PAT: ${{ secrets.PAT }} | ||
# Terraform Validate | ||
- name: Terraform Validate | ||
|
@@ -117,27 +95,21 @@ jobs: | |
id: terraform_plan | ||
working-directory: ${{ inputs.working_directory }} | ||
run: | | ||
terraform plan -var-file vars.${{ inputs.environment }}.tfvars -var='dns_api_password=${{ secrets.DNS_API_PASSWORD }}' -input=false | ||
terraform plan -var-file vars.${{ inputs.environment }}.tfvars -input=false | ||
apply: | ||
name: Terraform Apply | ||
runs-on: [self-hosted, linux, original] | ||
runs-on: [self-hosted] | ||
continue-on-error: false | ||
environment: ${{ inputs.environment }} | ||
# if: github.event_name == 'push' || github.event_name == 'release' | ||
needs: [lint, plan] | ||
outputs: | ||
mgmt_synapse_workspace_resource_group_name: ${{ steps.terraform_outputs.outputs.mgmt_synapse_workspace_resource_group_name }} | ||
mgmt_synapse_workspace_name: ${{ steps.terraform_outputs.outputs.mgmt_synapse_workspace_name }} | ||
mgmt_synapse_workspace_sql_pool_name: ${{ steps.terraform_outputs.outputs.mgmt_synapse_workspace_sql_pool_name }} | ||
mgmt_synapse_workspace_uri_sql: ${{ steps.terraform_outputs.outputs.mgmt_synapse_workspace_uri_sql }} | ||
mgmt_details: ${{ steps.terraform_outputs.outputs.mgmt_details }} | ||
core_details: ${{ steps.terraform_outputs.outputs.core_details }} | ||
extension_details: ${{ steps.terraform_outputs.outputs.extension_details }} | ||
test: ${{ steps.terraform_outputs.outputs.test }} | ||
|
||
env: | ||
ARM_TENANT_ID: ${{ secrets.TENANT_ID }} | ||
ARM_SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }} | ||
ARM_SUBSCRIPTION_ID: ${{ inputs.subscription_id }} | ||
ARM_CLIENT_ID: ${{ secrets.CLIENT_ID }} | ||
ARM_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | ||
ARM_USE_OIDC: false | ||
|
@@ -153,49 +125,28 @@ jobs: | |
id: azure_login | ||
uses: azure/login@v1 | ||
with: | ||
creds: '{"clientId":"${{ secrets.CLIENT_ID }}","clientSecret":"${{ secrets.CLIENT_SECRET }}","subscriptionId":"${{ secrets.SUBSCRIPTION_ID }}","tenantId":"${{ secrets.TENANT_ID }}"}' | ||
creds: '{"clientId":"${{ secrets.CLIENT_ID }}","clientSecret":"${{ secrets.CLIENT_SECRET }}","subscriptionId":"${{ inputs.subscription_id }}","tenantId":"${{ secrets.TENANT_ID }}"}' | ||
|
||
# Terraform Init | ||
- name: Terraform Init | ||
working-directory: ${{ inputs.working_directory }} | ||
run: | | ||
export HOME=$(pwd -P) | ||
git config --global url."https://[email protected]".insteadOf https://github.developer.allianz.io | ||
terraform init | ||
env: | ||
PAT: ${{ secrets.PAT }} | ||
# Terraform Apply | ||
- name: Terraform Apply | ||
working-directory: ${{ inputs.working_directory }} | ||
run: | | ||
terraform apply -var-file vars.${{ inputs.environment }}.tfvars -var='dns_api_password=${{ secrets.DNS_API_PASSWORD }}' -auto-approve -input=false | ||
terraform apply -var-file vars.${{ inputs.environment }}.tfvars -auto-approve -input=false | ||
# Terraform Export Outputs | ||
- name: Terraform Export Outputs | ||
id: terraform_outputs | ||
working-directory: ${{ inputs.working_directory }} | ||
if: inputs.export_terraform_outputs | ||
run: | | ||
mgmt_synapse_workspace_resource_group_name=$(terraform output -raw mgmt_synapse_workspace_resource_group_name) | ||
echo "mgmt_synapse_workspace_resource_group_name=$mgmt_synapse_workspace_resource_group_name" >> "$GITHUB_OUTPUT" | ||
mgmt_synapse_workspace_name=$(terraform output -raw mgmt_synapse_workspace_name) | ||
echo "mgmt_synapse_workspace_name=$mgmt_synapse_workspace_name" >> "$GITHUB_OUTPUT" | ||
mgmt_synapse_workspace_sql_pool_name=$(terraform output -raw mgmt_synapse_workspace_sql_pool_name) | ||
echo "mgmt_synapse_workspace_sql_pool_name=$mgmt_synapse_workspace_sql_pool_name" >> "$GITHUB_OUTPUT" | ||
mgmt_synapse_workspace_uri_sql=$(terraform output -raw mgmt_synapse_workspace_uri_sql) | ||
echo "mgmt_synapse_workspace_uri_sql=$mgmt_synapse_workspace_uri_sql" >> "$GITHUB_OUTPUT" | ||
mgmt_details=$(terraform output -raw mgmt_details) | ||
echo "mgmt_details=$mgmt_details" >> "$GITHUB_OUTPUT" | ||
core_details=$(terraform output -raw core_details) | ||
echo "core_details=$core_details" >> "$GITHUB_OUTPUT" | ||
extension_details=$(terraform output -raw extension_details) | ||
echo "extension_details=$extension_details" >> "$GITHUB_OUTPUT" | ||
test=$(terraform output -raw test) | ||
echo "test=$test" >> "$GITHUB_OUTPUT" | ||
# Log out from Azure | ||
- name: Log out from Azure | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.