Skip to content

Commit 7a5ab18

Browse files
committed
Work CI-CD
- Improve processing of condition to download specific nanoclr build. ***NO_CI***
1 parent 92b2c33 commit 7a5ab18

File tree

2 files changed

+6
-28
lines changed

2 files changed

+6
-28
lines changed

azure-pipelines-templates/check-nf-interpreter-to-test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ steps:
2929
# look for test prompt in PR commit message
3030
# pattern is "[tested against nanoclr buildId NNN]"
3131
32-
if($prCommitMessage -match "\[tested against nanoclr buildId (\d+)\]")
32+
if($prCommitMessage -match "\[tested against nanoclr buildId (\d+)\][\s.]*")
3333
{
3434
$buildId = $matches[1]
3535
"AZDO build ID found: $buildId" | Write-Host -ForegroundColor White
@@ -46,7 +46,7 @@ steps:
4646
- task: DownloadPipelineArtifact@2
4747
condition: >-
4848
and(
49-
eq(variables['DownloadNanoClrPreview'], true),
49+
succeeded(),
5050
ne(variables['NFINTERPRETER_BUILDID'], '')
5151
)
5252
displayName: Download nanoCLR preview
@@ -64,7 +64,6 @@ steps:
6464
condition: >-
6565
and(
6666
succeeded(),
67-
eq(variables['DownloadNanoClrPreview'], true),
6867
ne(variables['NFINTERPRETER_BUILDID'], '')
6968
)
7069
displayName: Set nanoCLR preview path

azure-pipelines.yml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -63,36 +63,18 @@ jobs:
6363
6464
# default to false
6565
$update = $false
66-
$downloadPreview = $false
66+
67+
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
68+
# 'encoded token' is the Base64 of the string "nfbot:personal-token"
69+
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
6770
6871
if($env:System_PullRequest_PullRequestNumber -ne $null)
6972
{
7073
# PR build
71-
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
72-
# 'encoded token' is the Base64 of the string "nfbot:personal-token"
73-
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
7474
7575
# find PR
7676
"Getting PR #$env:System_PullRequest_PullRequestNumber details..." | Write-Host -ForegroundColor White -NoNewline
7777
$pr = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:Build_Repository_Name/pulls/$env:System_PullRequest_PullRequestNumber" -Header @{"Authorization"="$auth"} -ContentType "application/json" -Method GET
78-
79-
if($($pr.number) -eq "$env:System_PullRequest_PullRequestNumber")
80-
{
81-
'OK' | Write-Host -ForegroundColor Green
82-
}
83-
84-
# grab PR commit message
85-
$prCommitMessage = $($pr.body)
86-
87-
# debug output
88-
# echo "=====`r`n$($prCommitMessage)`r`n====="
89-
90-
# check if should download nanoCLR to run unit tests
91-
if($prCommitMessage -match "\[tested against nanoclr buildId (\d+)\]")
92-
{
93-
Write-Host "##[command] **Download preview nanoCLR for unit tests**"
94-
$downloadPreview = $true
95-
}
9678
}
9779
else
9880
{
@@ -131,7 +113,6 @@ jobs:
131113
132114
# set variables to forward to jobs
133115
echo "##vso[task.setvariable variable=RUN_UPDATE_DEPENDENTS;isOutput=true]$update"
134-
echo "##vso[task.setvariable variable=DOWNLOAD_PREVIEW_NANOCLR;isOutput=true]$downloadPreview"
135116
name: GetPRLabels
136117
displayName: Check build conditions
137118
@@ -160,8 +141,6 @@ jobs:
160141
value: 'nanoFramework.Tools.MetadataProcessor.sln'
161142
- name: NF_MDP_MSBUILDTASK_PATH
162143
value: '$(System.DefaultWorkingDirectory)/MetadataProcessor.MsBuildTask/bin/Release/net472'
163-
- name: DownloadNanoClrPreview
164-
value: $[ dependencies.Build_Prep.outputs['GetPRLabels.DOWNLOAD_PREVIEW_NANOCLR'] ]
165144

166145
steps:
167146

0 commit comments

Comments
 (0)