-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
56 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 |
---|---|---|
|
@@ -4,62 +4,61 @@ on: | |
workflow_call: | ||
inputs: | ||
path: | ||
description: 'Specifies the path of the root terraform module.' | ||
description: "Specifies the path of the root terraform module." | ||
required: true | ||
type: string | ||
tf_version: | ||
description: 'Specifies version of Terraform to use. e.g: 1.1.0 Default=latest.' | ||
description: "Specifies version of Terraform to use. e.g: 1.1.0 Default=latest." | ||
required: false | ||
type: string | ||
default: latest | ||
gh_environment: | ||
description: 'Specifies the GitHub deployment environment.' | ||
description: "Specifies the GitHub deployment environment." | ||
required: false | ||
type: string | ||
default: null | ||
tf_vars_file: | ||
description: 'Specifies the Terraform TFVARS file.' | ||
description: "Specifies the Terraform TFVARS file." | ||
required: true | ||
type: string | ||
task_container_version: | ||
description: 'Specifies the version of the container to deploy.' | ||
description: "Specifies the version of the container to deploy." | ||
required: true | ||
type: string | ||
task_container_registry: | ||
description: 'Task Container Registry' | ||
required: true | ||
type: string | ||
description: "Task Container Registry" | ||
required: true | ||
type: string | ||
task_container_name: | ||
description: 'Task Container Name' | ||
required: true | ||
type: string | ||
description: "Task Container Name" | ||
required: true | ||
type: string | ||
secrets: | ||
cli_config_credentials_token: | ||
description: 'CLI configuration credentials token' | ||
description: "CLI configuration credentials token" | ||
required: true | ||
azure_acr_username: | ||
description: 'Azure ACR (Azure Container Registry) username' | ||
description: "Azure ACR (Azure Container Registry) username" | ||
required: true | ||
azure_acr_password: | ||
description: 'Azure ACR (Azure Container Registry) password' | ||
description: "Azure ACR (Azure Container Registry) password" | ||
required: true | ||
azure_tenant_id: | ||
description: 'Azure Tenant ID for the subscription' | ||
description: "Azure Tenant ID for the subscription" | ||
required: true | ||
azure_subscription_id: | ||
description: 'Azure subscription ID' | ||
description: "Azure subscription ID" | ||
required: true | ||
azure_client_id: | ||
description: 'Azure Client ID' | ||
description: "Azure Client ID" | ||
required: true | ||
azure_client_secret: | ||
description: 'Azure Client Secret' | ||
description: "Azure Client Secret" | ||
required: true | ||
github_personal_access_token: | ||
description: 'GitHub Personal Access Token' | ||
description: "GitHub Personal Access Token" | ||
required: true | ||
|
||
|
||
jobs: | ||
build-plan: | ||
runs-on: ubuntu-latest | ||
|
@@ -69,11 +68,11 @@ jobs: | |
run: | ||
shell: bash | ||
working-directory: ${{ inputs.path }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Download file | ||
uses: actions/download-artifact@v2 | ||
with: | ||
|
@@ -89,30 +88,29 @@ jobs: | |
with: | ||
terraform_version: ${{ inputs.tf_version }} | ||
cli_config_credentials_token: ${{ secrets.cli_config_credentials_token }} | ||
|
||
- name: Terraform Init | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.github_personal_access_token }} | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
TF_WORKSPACE: ${{ inputs.gh_environment }} | ||
run: | | ||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" | ||
terraform init | ||
# - name: Terraform Workspace Creation | ||
# run: terraform workspace new ${{ inputs.task_container_name }}-${{ inputs.gh_environment }} || true | ||
|
||
# - name: Terraform Workspace Selection | ||
# run: terraform workspace select ${{ inputs.task_container_name }}-${{ inputs.gh_environment }} | ||
|
||
- name: Terraform Validate | ||
id: validate | ||
run: terraform validate | ||
|
||
- name: Terraform Plan | ||
id: plan | ||
env: | ||
TF_VAR_region: 'us-west-1' #replace with your variable and value | ||
TF_VAR_region: "us-west-1" #replace with your variable and value | ||
TF_VAR_azure_client_id: ${{ secrets.azure_client_id }} | ||
TF_VAR_azure_client_secret: ${{ secrets.azure_client_secret }} | ||
TF_VAR_subscription_id: ${{ secrets.azure_subscription_id }} | ||
|
@@ -136,7 +134,7 @@ jobs: | |
- name: Terraform Apply | ||
run: terraform apply -auto-approve | ||
env: | ||
TF_VAR_region: 'us-west-1' #replace with your variable and value | ||
TF_VAR_region: "us-west-1" #replace with your variable and value | ||
TF_VAR_azure_client_id: ${{ secrets.azure_client_id }} | ||
TF_VAR_azure_client_secret: ${{ secrets.azure_client_secret }} | ||
TF_VAR_subscription_id: ${{ secrets.azure_subscription_id }} | ||
|
@@ -149,4 +147,4 @@ jobs: | |
TF_VAR_github_personal_access_token: ${{ secrets.github_personal_access_token }} | ||
TF_VAR_environment: ${{ inputs.gh_environment }} | ||
TF_WORKSPACE: ${{ inputs.gh_environment }} | ||
TF_environment: ${{ inputs.gh_environment }} | ||
TF_environment: ${{ inputs.gh_environment }} |
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 |
---|---|---|
|
@@ -4,62 +4,61 @@ on: | |
workflow_call: | ||
inputs: | ||
path: | ||
description: 'Specifies the path of the root terraform module.' | ||
description: "Specifies the path of the root terraform module." | ||
required: true | ||
type: string | ||
tf_version: | ||
description: 'Specifies version of Terraform to use. e.g: 1.1.0 Default=latest.' | ||
description: "Specifies version of Terraform to use. e.g: 1.1.0 Default=latest." | ||
required: false | ||
type: string | ||
default: latest | ||
gh_environment: | ||
description: 'Specifies the GitHub deployment environment.' | ||
description: "Specifies the GitHub deployment environment." | ||
required: false | ||
type: string | ||
default: null | ||
tf_vars_file: | ||
description: 'Specifies the Terraform TFVARS file.' | ||
description: "Specifies the Terraform TFVARS file." | ||
required: true | ||
type: string | ||
task_container_version: | ||
description: 'Specifies the version of the container to deploy.' | ||
description: "Specifies the version of the container to deploy." | ||
required: true | ||
type: string | ||
task_container_registry: | ||
description: 'Task Container Registry' | ||
required: true | ||
type: string | ||
description: "Task Container Registry" | ||
required: true | ||
type: string | ||
task_container_name: | ||
description: 'Task Container Name' | ||
required: true | ||
type: string | ||
description: "Task Container Name" | ||
required: true | ||
type: string | ||
secrets: | ||
cli_config_credentials_token: | ||
description: 'CLI configuration credentials token' | ||
description: "CLI configuration credentials token" | ||
required: true | ||
azure_acr_username: | ||
description: 'Azure ACR (Azure Container Registry) username' | ||
description: "Azure ACR (Azure Container Registry) username" | ||
required: true | ||
azure_acr_password: | ||
description: 'Azure ACR (Azure Container Registry) password' | ||
description: "Azure ACR (Azure Container Registry) password" | ||
required: true | ||
azure_tenant_id: | ||
description: 'Azure Tenant ID for the subscription' | ||
description: "Azure Tenant ID for the subscription" | ||
required: true | ||
azure_subscription_id: | ||
description: 'Azure subscription ID' | ||
description: "Azure subscription ID" | ||
required: true | ||
azure_client_id: | ||
description: 'Azure Client ID' | ||
description: "Azure Client ID" | ||
required: true | ||
azure_client_secret: | ||
description: 'Azure Client Secret' | ||
description: "Azure Client Secret" | ||
required: true | ||
github_personal_access_token: | ||
description: 'GitHub Personal Access Token' | ||
description: "GitHub Personal Access Token" | ||
required: true | ||
|
||
|
||
jobs: | ||
build-plan: | ||
runs-on: ubuntu-latest | ||
|
@@ -69,11 +68,11 @@ jobs: | |
run: | ||
shell: bash | ||
working-directory: ${{ inputs.path }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Download file | ||
uses: actions/download-artifact@v2 | ||
with: | ||
|
@@ -92,20 +91,20 @@ jobs: | |
|
||
- name: Terraform Init | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.github_personal_access_token }} | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
TF_WORKSPACE: ${{ inputs.gh_environment }} | ||
run: | | ||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" | ||
terraform init | ||
- name: Terraform Validate | ||
id: validate | ||
run: terraform validate | ||
|
||
- name: Terraform Plan | ||
id: plan | ||
env: | ||
TF_VAR_region: 'us-west-1' #replace with your variable and value | ||
TF_VAR_region: "us-west-1" #replace with your variable and value | ||
TF_VAR_azure_client_id: ${{ secrets.azure_client_id }} | ||
TF_VAR_azure_client_secret: ${{ secrets.azure_client_secret }} | ||
TF_VAR_subscription_id: ${{ secrets.azure_subscription_id }} | ||
|