Skip to content

Commit ff4143c

Browse files
authored
Build and release activity separated in release pipeline (#446)
* Udpate pipeline to classify as a 'release job' for internal Microsoft compliance. * Separate the release tasks from the build tasks (requirement of 1ES template). * Added missing template context for the build job. * Upgrade pool used to Azure Linux (3.0) as Mariner 2.0 is being deprecated in July. * Use our test pool to ensure the new Azure Linux machines are set up properly * Corrections for Azure Linux agents * Disable guardian anti-malware scan, not supported on AzLinux yet. * Dry-runs should not fail the build. NOTE: Pool remains on JEG-test-pool until after the July PSU.
1 parent 54e339e commit ff4143c

File tree

2 files changed

+50
-8
lines changed

2 files changed

+50
-8
lines changed

.devops/gctoolkit-release.yml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extends:
4242
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
4343
parameters:
4444
pool:
45-
name: JEG-mariner2.0-x64-release
45+
name: JEG-test-pool
4646
os: linux
4747
sdl:
4848
sourceAnalysisPool:
@@ -60,12 +60,36 @@ extends:
6060
- job: build_gctoolkit
6161
workspace:
6262
clean: all
63-
displayName: Build with Maven
63+
displayName: Build GCToolkit with Maven
64+
templateContext:
65+
# Disable Defender for Linux since it is not supported by Azure Linux.
66+
# More info here: https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sdlanalysis/antimalware
67+
sdl:
68+
antimalwareScan:
69+
enabled: false
70+
justificationForDisabling: Disabling Defender for Linux as its not supported in Azure Linux 3
71+
outputs:
72+
- output: pipelineArtifact
73+
targetPath: $(Build.ArtifactStagingDirectory)/staging
74+
artifactName: staged-artifacts
75+
6476
steps:
6577
- checkout: gctoolkit
6678
path: gctoolkit
6779
clean: true
6880

81+
# Find out what is installed on the agents...
82+
- bash: |
83+
echo "Installed Tools and versions:"
84+
find /opt/hostedtoolcache -mindepth 1 -type d | while read dir; do
85+
if [[ "$dir" == *jdk* ]]; then
86+
echo "👉 $dir"
87+
else
88+
echo "$dir"
89+
fi
90+
done
91+
displayName: 'Show installed tools'
92+
6993
# Use modern Java to build
7094
- task: JavaToolInstaller@0
7195
inputs:
@@ -200,11 +224,23 @@ extends:
200224
workingDirectory: $(Build.ArtifactStagingDirectory)
201225
displayName: Create sha256sums
202226
203-
- task: 1ES.PublishPipelineArtifact@1
204-
inputs:
205-
targetPath: '$(Build.ArtifactStagingDirectory)/staging'
206-
artifactName: staged-artifacts
207227
228+
# Release jobs have to be separated from build jobs for our internal release service to be compliant
229+
- job: release_gctoolkit_to_maven_central
230+
dependsOn: build_gctoolkit
231+
workspace:
232+
clean: all
233+
displayName: Release GCToolkit to Maven Central
234+
templateContext:
235+
type: releaseJob
236+
isProduction: true
237+
inputs: # Pull the staged artifacts from the build job.
238+
- input: pipelineArtifact
239+
artifactName: staged-artifacts
240+
targetPath: '$(Build.ArtifactStagingDirectory)/staging'
241+
242+
steps:
243+
# ESRP Release task docs at aka.ms/esrp under 'ESRP Portal Help'
208244
- task: EsrpRelease@8
209245
inputs:
210246
connectedservicename: 'JEG-Tooling-Prod'
@@ -214,6 +250,8 @@ extends:
214250
clientid: '516af6d8-6ab4-4069-8f64-b18c64d16688'
215251
intent: 'PackageDistribution'
216252
# Test with contentype PyPI to avoid publishing to Maven Central
253+
# NOTE: This is the guidance given in ESRP portal for testing
254+
# the flow during dry-runs, see aka.ms/esrp.
217255
${{ if eq(parameters.release_type, 'release') }}:
218256
contenttype: 'Maven'
219257
${{ else }}:
@@ -222,8 +260,12 @@ extends:
222260
folderlocation: '$(Build.ArtifactStagingDirectory)/staging/com/microsoft/gctoolkit'
223261
waitforreleasecompletion: true
224262
225-
approvers: 'milderhc@microsoft.com,john.oliver@microsoft.com,[email protected],kirk.pepperdine@microsoft.com'
263+
approvers: 'maverbur@microsoft.com,[email protected]'
226264
serviceendpointurl: 'https://api.esrp.microsoft.com'
227265
mainpublisher: 'ESRPRELPACMAN'
228266
domaintenantid: '33e01921-4d64-4f8c-a055-5bdaffd5e33d'
229267
displayName: 'Publish to Maven Central'
268+
# For non-release runs, allow this task to fail (it should!) so the
269+
# pipeline does not appear to fail when it doesn't.
270+
continueOnError: ${{ ne(parameters.release_type, 'release') }}
271+

.devops/weekly-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ variables:
1212
JAVA_HOME_11_X64: /usr/lib/jvm/msopenjdk-11
1313

1414
pool:
15-
name: JEG-mariner2.0-x64-release
15+
name: JEG-azurelinux-x64-release
1616

1717
steps:
1818
- task: JavaToolInstaller@0

0 commit comments

Comments
 (0)