Skip to content

Commit

Permalink
endgame
Browse files Browse the repository at this point in the history
  • Loading branch information
hossam-nasr committed May 14, 2024
1 parent 412966f commit f8c1bc2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 48 deletions.
6 changes: 1 addition & 5 deletions azure-pipelines/1esstages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ stages:
- template: ./templates/setup.yml
- template: ./templates/build.yml
- template: ./templates/1espackage.yml
- template: ./templates/test.nightly.yml
- template: ./templates/test.yml
parameters:
useAzureFederatedCredentials: ${{ parameters.useAzureFederatedCredentials }}
# - ${{ if ne(parameters.useAzureFederatedCredentials, true) }}:
# - template: ./templates/test.yml
# - ${{ if eq(parameters.useAzureFederatedCredentials, true) }}:
# - template: ./templates/test.nightly.yml
variables:
artifact_name: ${{ job.name }}
working_directory: ${{ job.working_directory }}
Expand Down
43 changes: 0 additions & 43 deletions azure-pipelines/templates/test.nightly.yml

This file was deleted.

33 changes: 33 additions & 0 deletions azure-pipelines/templates/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
parameters:
- name: useAzureFederatedCredentials
type: boolean
default: false

steps:
# This gives the AzCodeE2ETests service connection access to this pipeline.
- ${{ if eq(parameters.useAzureFederatedCredentials, true) }}:
- task: AzureKeyVault@1
displayName: "\U0001F449 Authorize AzCodeE2ETests service connection"
inputs:
azureSubscription: 'AzCodeE2ETests'
KeyVaultName: 'AzCodeE2ETestsDummyKV'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

# This task obtains the values necessary to connect to the AzCodeE2ETests service connection from the AzCodeE2ETestsCredKV key vault.
- ${{ if eq(parameters.useAzureFederatedCredentials, true) }}:
- task: AzureKeyVault@2
displayName: "\U0001F449 Get AzCodeE2ETests service connection secrets"
inputs:
azureSubscription: 'AzCodeE2ETestsCreds'
KeyVaultName: 'AzCodeE2ETestsCredsKV'
SecretsFilter: 'AzCodeServiceConnectionID, AzCodeServiceConnectionDomain, AzCodeServiceConnectionClientID'
RunAsPreJob: true
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

- task: Npm@1
displayName: "\U0001F449 Test"
inputs:
Expand All @@ -8,3 +35,9 @@ steps:
condition: succeeded()
env:
DISPLAY: :99 # Only necessary for linux tests
${{ if eq(parameters.useAzureFederatedCredentials, true) }}:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
AzCode_ServiceConnectionID: $(AzCodeServiceConnectionID)
AzCode_ServiceConnectionDomain: $(AzCodeServiceConnectionDomain)
AzCode_ServiceConnectionClientID: $(AzCodeServiceConnectionClientID)

0 comments on commit f8c1bc2

Please sign in to comment.