-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipeline-key-auth.yml
60 lines (57 loc) · 1.94 KB
/
azure-pipeline-key-auth.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
trigger:
- main
pr:
branches:
include:
- '*' # must quote since "*" is a YAML reserved character; we want a string
pool:
vmImage: ubuntu-latest
stages:
- stage: Validate
condition: eq(variables['Build.Reason'], 'PullRequest')
jobs:
- job: DryRun
steps:
- task: Bash@3
displayName: "Tram Fetch"
inputs:
filePath: bin/tram-fetch
env:
TRAM_ENTITLEMENT_TOKEN: $(TramEntitlementToken)
- task: DownloadSecureFile@1
name: snowflake_key
displayName: 'Download Snowflake Key File'
inputs:
secureFile: 'snowflake_key.p8'
- task: Bash@3
displayName: "Tram Dry Run"
inputs:
filePath: bin/tram-dry-run
env:
TRAM_SNOWFLAKE_URL: '$(TramSnowflakeUrl)$(snowflake_key.secureFilePath)&private_key_file_pwd=$(TramSnowflakePrivKeyPassword)'
TRAM_SNOWFLAKE_USER: $(TramSnowflakeUser)
STACK_PATH: stacks/source-product
- stage: Deploy
condition: eq(variables['Build.SourceBranchName'], 'main')
jobs:
- job: Deploy
steps:
- task: Bash@3
displayName: "Tram Fetch"
inputs:
filePath: bin/tram-fetch
env:
TRAM_ENTITLEMENT_TOKEN: $(TramEntitlementToken)
- task: DownloadSecureFile@1
name: snowflake_key
displayName: 'Download Snowflake Key File'
inputs:
secureFile: 'snowflake_key.p8'
- task: Bash@3
displayName: "Tram Provision"
inputs:
filePath: bin/tram-provision
env:
TRAM_SNOWFLAKE_URL: '$(TramSnowflakeUrl)$(snowflake_key.secureFilePath)&private_key_file_pwd=$(TramSnowflakePrivKeyPassword)'
TRAM_SNOWFLAKE_USER: $(TramSnowflakeUser)
STACK_PATH: stacks/source-product