@@ -29,7 +29,7 @@ parameters:
2929 default : []
3030 - name : python_version
3131 type : string
32- default : " 3.8 "
32+ default : " 3.9 "
3333 - name : agent_pool
3434 type : string
3535 default : " AWS-ECS"
4646 ${{ each var in parameters.variables }} :
4747 ${{ var.key }} : ${{ var.value }}
4848 steps :
49-
5049 - bash : |
5150 if [ ! -z "$(ls -A \"$(Pipeline.Workspace)/s/${{ parameters.service_name }}\" 2>/dev/null)" ]; then
5251 echo "workspace directory is not empty!"
@@ -67,63 +66,63 @@ jobs:
6766 - template : ../components/aws-clean-config.yml
6867
6968 - ${{ if parameters.notify }} :
70- - template : ../components/aws-assume-role.yml
71- parameters :
72- role : " auto-ops"
73- profile : " apm_ptl"
74-
75- - template : ../components/get-aws-secrets-and-ssm-params.yml
76- parameters :
77- secret_file_ids :
78- - ${{ each secret_file_id in parameters.secret_file_ids }} :
79- - ${{ secret_file_id }}
80- secret_ids :
81- - ptl/access-tokens/github/repo-status-update/GITHUB_ACCESS_TOKEN
82- - ${{ each secret_id in parameters.secret_ids }} :
83- - ${{ secret_id }}
84- config_ids :
85- - /ptl/azure-devops/GITHUB_USER
86- - ${{ each config_id in parameters.config_ids }} :
87- - ${{ config_id }}
88-
89- - bash : |
90- echo "Build.SourceBranch: $(Build.SourceBranch)"
91- echo "Build.SourceBranchName: $(Build.SourceBranchName)"
92- echo "Build.SourceVersion: $(Build.SourceVersion)"
93- echo "Build.SourceVersionMessage: $(Build.SourceVersionMessage)"
94-
95- if [[ ! -z $(NOTIFY_COMMIT_SHA) ]]; then
96- echo "##[debug]Using already provided NOTIFY_COMMIT_SHA=$(NOTIFY_COMMIT_SHA)"
97- else
98- NOTIFY_COMMIT_SHA=""
99-
100- if [[ "$(Build.SourceBranch)" =~ ^refs/tags/.+$ ]]; then
101- echo "##[debug]Build appears to be a tag build"
102- echo "##[debug]Using Build.SourceVersion as NOTIFY_COMMIT_SHA"
103- NOTIFY_COMMIT_SHA="$(Build.SourceVersion)"
104- fi
105-
106- if [[ "$(Build.SourceBranch)" =~ ^refs/pull/.+$ ]]; then
107- echo "##[debug]Build appears to be a pull request build"
108- echo "##[debug]Extracting NOTIFY_COMMIT_SHA from Build.SourceVersionMessage"
109- NOTIFY_COMMIT_SHA=`echo "$(Build.SourceVersionMessage)" | cut -d' ' -f2`
110- fi
111-
112- if [[ -z $NOTIFY_COMMIT_SHA ]]; then
113- echo "##[debug]Build does not appear to be pull or tag build"
114- echo "##[debug]Using Build.SourceVersion as NOTIFY_COMMIT_SHA"
115- NOTIFY_COMMIT_SHA="$(Build.SourceVersion)"
116- fi
117-
118- echo "##vso[task.setvariable variable=NOTIFY_COMMIT_SHA]$NOTIFY_COMMIT_SHA"
119- fi
120- displayName: Set NOTIFY_COMMIT_SHA
121- condition: always()
122-
123- - template : ' ../components/update-github-status.yml'
124- parameters :
125- state : pending
126- description : " Build started"
69+ - template : ../components/aws-assume-role.yml
70+ parameters :
71+ role : " auto-ops"
72+ profile : " apm_ptl"
73+
74+ - template : ../components/get-aws-secrets-and-ssm-params.yml
75+ parameters :
76+ secret_file_ids :
77+ - ${{ each secret_file_id in parameters.secret_file_ids }} :
78+ - ${{ secret_file_id }}
79+ secret_ids :
80+ - ptl/access-tokens/github/repo-status-update/GITHUB_ACCESS_TOKEN
81+ - ${{ each secret_id in parameters.secret_ids }} :
82+ - ${{ secret_id }}
83+ config_ids :
84+ - /ptl/azure-devops/GITHUB_USER
85+ - ${{ each config_id in parameters.config_ids }} :
86+ - ${{ config_id }}
87+
88+ - bash : |
89+ echo "Build.SourceBranch: $(Build.SourceBranch)"
90+ echo "Build.SourceBranchName: $(Build.SourceBranchName)"
91+ echo "Build.SourceVersion: $(Build.SourceVersion)"
92+ echo "Build.SourceVersionMessage: $(Build.SourceVersionMessage)"
93+
94+ if [[ ! -z $(NOTIFY_COMMIT_SHA) ]]; then
95+ echo "##[debug]Using already provided NOTIFY_COMMIT_SHA=$(NOTIFY_COMMIT_SHA)"
96+ else
97+ NOTIFY_COMMIT_SHA=""
98+
99+ if [[ "$(Build.SourceBranch)" =~ ^refs/tags/.+$ ]]; then
100+ echo "##[debug]Build appears to be a tag build"
101+ echo "##[debug]Using Build.SourceVersion as NOTIFY_COMMIT_SHA"
102+ NOTIFY_COMMIT_SHA="$(Build.SourceVersion)"
103+ fi
104+
105+ if [[ "$(Build.SourceBranch)" =~ ^refs/pull/.+$ ]]; then
106+ echo "##[debug]Build appears to be a pull request build"
107+ echo "##[debug]Extracting NOTIFY_COMMIT_SHA from Build.SourceVersionMessage"
108+ NOTIFY_COMMIT_SHA=`echo "$(Build.SourceVersionMessage)" | cut -d' ' -f2`
109+ fi
110+
111+ if [[ -z $NOTIFY_COMMIT_SHA ]]; then
112+ echo "##[debug]Build does not appear to be pull or tag build"
113+ echo "##[debug]Using Build.SourceVersion as NOTIFY_COMMIT_SHA"
114+ NOTIFY_COMMIT_SHA="$(Build.SourceVersion)"
115+ fi
116+
117+ echo "##vso[task.setvariable variable=NOTIFY_COMMIT_SHA]$NOTIFY_COMMIT_SHA"
118+ fi
119+ displayName: Set NOTIFY_COMMIT_SHA
120+ condition: always()
121+
122+ - template : " ../components/update-github-status.yml"
123+ parameters :
124+ state : pending
125+ description : " Build started"
127126
128127 - bash : |
129128 if [[ ! -z $(UTILS_PR_NUMBER) ]]; then
@@ -193,12 +192,12 @@ jobs:
193192 key : poetry | $(System.DefaultWorkingDirectory) | ${{ parameters.service_name }}/utils/poetry.lock
194193 location : " ${{ parameters.service_name }}/utils/.venv"
195194 debug : true
196- alias : ' Utils'
195+ alias : " Utils"
197196 displayName : cache utils dependencies
198197
199198 - bash : |
200- make install
201- sleep 5
199+ make install
200+ sleep 5
202201 workingDirectory: "${{ parameters.service_name }}/utils"
203202 condition: ne(variables['CacheRestored-Utils'], 'true')
204203 displayName: "Install utils "
@@ -277,14 +276,14 @@ jobs:
277276 artifact : " $(Build.BuildNumber)"
278277
279278 - ${{ if parameters.notify }} :
280- - template : ' ../components/update-github-status.yml'
281- parameters :
282- state : success
283- on_success : true
284- description : " Build succeeded"
285-
286- - template : ' ../components/update-github-status.yml'
287- parameters :
288- state : failure
289- on_failure : true
290- description : " Build failed"
279+ - template : " ../components/update-github-status.yml"
280+ parameters :
281+ state : success
282+ on_success : true
283+ description : " Build succeeded"
284+
285+ - template : " ../components/update-github-status.yml"
286+ parameters :
287+ state : failure
288+ on_failure : true
289+ description : " Build failed"
0 commit comments