@@ -39,8 +39,6 @@ variables:
39
39
stages :
40
40
- stage : Containerized_CI
41
41
variables :
42
- - name : PR_NUMBER
43
- value : " "
44
42
- name : TAG
45
43
value : " "
46
44
jobs :
@@ -50,33 +48,39 @@ stages:
50
48
steps :
51
49
# Debugging: Output the SourceBranch value
52
50
- bash : |
51
+ echo "DEBUG: Inspecting System.PullRequest.SourceBranch..."
53
52
echo "System.PullRequest.SourceBranch is: $(System.PullRequest.SourceBranch)"
54
53
echo "System.PullRequest.SourceCommitId is: $(System.PullRequest.SourceCommitId)"
55
- echo "##vso[task.logissue type=warning] Debug output: Source Branch: $(System.PullRequest.SourceBranch), Commit SHA: $(System.PullRequest.SourceCommitId )"
54
+ echo "##vso[task.logissue type=warning] Source Branch: $(System.PullRequest.SourceBranch)"
56
55
displayName: Debug Source Branch Information
57
56
58
- # Extract PR Number
57
+ # Extract PR Number with fallback logic
59
58
- bash : |
60
59
echo "Extracting PR Number from Source Branch..."
61
60
PR_NUMBER=$(echo $(System.PullRequest.SourceBranch) | grep -oP '(?<=refs/pull/)\d+(?=/merge)')
62
61
63
- # Check if extraction succeeded
62
+ # Handle case when PR_NUMBER is not extracted
64
63
if [ -z "$PR_NUMBER" ]; then
65
- echo "##vso[task.logissue type=error] Failed to extract PR number. Please verify the branch name format: $(System.PullRequest.SourceBranch)"
66
- exit 1
64
+ echo "##vso[task.logissue type=error] Failed to extract PR number. Branch format: $(System.PullRequest.SourceBranch)"
65
+ exit 1
67
66
fi
68
-
69
67
echo "Extracted PR Number: $PR_NUMBER"
70
68
echo "##vso[task.setvariable variable=PR_NUMBER]$PR_NUMBER"
71
- displayName: Extract PR Number from Source Branch
72
-
73
- # Generate TAG Variable
74
- - bash : |
75
- echo "Generating TAG variable..."
69
+
70
+ # Generate TAG variable
76
71
TAG=pr-$(PR_NUMBER)-$(System.PullRequest.SourceCommitId)
77
72
echo "Generated TAG: $TAG"
78
73
echo "##vso[task.setvariable variable=TAG]$TAG"
79
- displayName: Generate Image Tag
74
+ displayName: Extract PR Number and Generate TAG
75
+
76
+ - job : Build_Test_And_Push_Az_ARO_Extension
77
+ dependsOn : Extract_PR_Number
78
+ variables :
79
+ TAG : $(TAG)
80
+ pool :
81
+ name : 1es-aro-ci-pool
82
+ steps :
83
+ - template : ./templates/template-checkout.yml
80
84
81
85
# Build and test the Az ARO Extension
82
86
- script : |
@@ -90,9 +94,12 @@ stages:
90
94
acrFQDN : ' arosvcdev.azurecr.io'
91
95
repository : ' azext-aro'
92
96
tag : $(TAG)
93
- pushLatest : true
97
+ pushLatest : false
94
98
95
99
- job : Build_And_Test_RP_And_Portal
100
+ dependsOn : Extract_PR_Number
101
+ variables :
102
+ TAG : $(TAG)
96
103
pool :
97
104
name : 1es-aro-ci-pool
98
105
steps :
@@ -104,31 +111,18 @@ stages:
104
111
DOCKER_BUILD_CI_ARGS="--load" make ci-rp VERSION=$(TAG)
105
112
displayName: 🛠 Build & Test RP and Portal
106
113
107
- # Publish test results
108
- - task : PublishTestResults@2
109
- displayName : 📊 Publish tests results
110
- inputs :
111
- testResultsFiles : $(System.DefaultWorkingDirectory)/report.xml
112
- condition : succeededOrFailed()
113
-
114
- # Publish code coverage results
115
- - task : PublishCodeCoverageResults@2
116
- displayName : 📈 Publish code coverage
117
- inputs :
118
- codeCoverageTool : Cobertura
119
- summaryFileLocation : $(System.DefaultWorkingDirectory)/coverage.xml
120
- failIfCoverageEmpty : false
121
- condition : succeededOrFailed()
122
-
123
114
# Push the RP image to ACR
124
115
- template : ./templates/template-acr-push.yml
125
116
parameters :
126
117
acrFQDN : ' arosvcdev.azurecr.io'
127
118
repository : ' aro'
128
119
tag : $(TAG)
129
- pushLatest : true
120
+ pushLatest : false
130
121
131
122
- job : Build_And_Push_E2E_Image
123
+ dependsOn : Extract_PR_Number
124
+ variables :
125
+ TAG : $(TAG)
132
126
pool :
133
127
name : 1es-aro-ci-pool
134
128
steps :
@@ -146,7 +140,8 @@ stages:
146
140
acrFQDN : ' arosvcdev.azurecr.io'
147
141
repository : ' e2e'
148
142
tag : $(TAG)
149
- pushLatest : true
143
+ pushLatest : false
144
+
150
145
151
146
- stage : E2E # E2E Stage using Docker Compose
152
147
dependsOn : Containerized_CI
0 commit comments