From a8c5adeadfa0674ddfda6c3bce153bf897d8483b Mon Sep 17 00:00:00 2001 From: Alex Bance Date: Mon, 13 Jan 2025 17:30:43 +0000 Subject: [PATCH 1/3] fix: added generate ansible inventory prestep --- infra-pipeline.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/infra-pipeline.yaml b/infra-pipeline.yaml index 6476c4e7..1fa52a88 100644 --- a/infra-pipeline.yaml +++ b/infra-pipeline.yaml @@ -47,6 +47,14 @@ parameters: component: inventory destroy: false deploy: true + preStep: + - task: AzureCLI@2 + displayName: Download GitHub Private Key + inputs: + azureSubscription: "MSDN Sub" + scriptType: "bash" + scriptLocation: "inlineScript" + inlineScript: az keyvault secret download --name GitHub-Bot-Private-Key --vault-name bancey-vault --file $(System.DefaultWorkingDirectory)/private-key.pem dependsOn: [] - deployment: prod_twingate environment: prod From 38e564338d29c8ab0501ca1cec966ab2e4becc4b Mon Sep 17 00:00:00 2001 From: Alex Bance Date: Mon, 13 Jan 2025 17:31:37 +0000 Subject: [PATCH 2/3] fix: condition to run when there isn't a PR linked --- infra-pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/infra-pipeline.yaml b/infra-pipeline.yaml index 1fa52a88..8bfac514 100644 --- a/infra-pipeline.yaml +++ b/infra-pipeline.yaml @@ -50,6 +50,7 @@ parameters: preStep: - task: AzureCLI@2 displayName: Download GitHub Private Key + condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestNumber'], '')) inputs: azureSubscription: "MSDN Sub" scriptType: "bash" From c1b5756d5fa0c131bf218e94a2f8f8d6ae54d8d8 Mon Sep 17 00:00:00 2001 From: Alex Bance Date: Mon, 13 Jan 2025 17:32:44 +0000 Subject: [PATCH 3/3] fix: correct condition --- infra-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra-pipeline.yaml b/infra-pipeline.yaml index 8bfac514..ee427198 100644 --- a/infra-pipeline.yaml +++ b/infra-pipeline.yaml @@ -50,7 +50,7 @@ parameters: preStep: - task: AzureCLI@2 displayName: Download GitHub Private Key - condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestNumber'], '')) + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) inputs: azureSubscription: "MSDN Sub" scriptType: "bash"