|
| 1 | +# This script is used to prepare the patch release by generating patches for automatic releases. |
| 2 | +# It should be triggered manually by the release driver. Release driver should ensure that the CI pipeline is green |
| 3 | +# before manually trigger the patch release pipeline, 'java - patch-release'. |
| 4 | +# The release driver should also ensure that the patches are generated successfully and the PR is created successfully. |
| 5 | +# |
| 6 | +# What this script does: |
| 7 | +# - Checks out a new release branch, 'release/patch/$currentDate' |
| 8 | +# - Runs the script to generate patches for automatic releases |
| 9 | +# - Create a PR with the patches prepared |
| 10 | + |
| 11 | +trigger: none |
| 12 | +pr: none |
| 13 | + |
| 14 | +parameters: |
| 15 | + - name: TestPipeline |
| 16 | + type: boolean |
| 17 | + default: false |
| 18 | + |
| 19 | +stages: |
| 20 | + - stage: PreparePatchRelease |
| 21 | + displayName: Prepare Patch Release |
| 22 | + jobs: |
| 23 | + - job: PreparePatchRelease |
| 24 | + displayName: 'Prepare Patch Release' |
| 25 | + timeoutInMinutes: 30 |
| 26 | + pool: |
| 27 | + name: azsdk-pool-mms-ubuntu-2004-general |
| 28 | + image: azsdk-pool-mms-ubuntu-2004-1espt |
| 29 | + os: linux |
| 30 | + steps: |
| 31 | + # Checkout a new release branch |
| 32 | + - pwsh: | |
| 33 | + $currentDate = Get-Date -Format "yyyyMMdd" |
| 34 | + $branchName = "release/patch/$currentDate" |
| 35 | + Write-Host "git checkout main" |
| 36 | + git checkout main |
| 37 | + Write-Host "git checkout -b $branchName" |
| 38 | + git checkout -b $branchName |
| 39 | + workingDirectory: $(Build.SourcesDirectory) |
| 40 | + displayName: 'Create release branch' |
| 41 | + # Run the script to generate patches for automatic releases |
| 42 | + - task: PowerShell@2 |
| 43 | + displayName: 'Run Generate-Patches-For-Automatic-Releases script' |
| 44 | + inputs: |
| 45 | + pwsh: true |
| 46 | + filePath: eng/scripts/Generate-Patches-For-Automatic-Releases.ps1 |
| 47 | + arguments: > |
| 48 | + -SourcesDirectory . |
| 49 | + -PackagesYmlPath eng/pipelines/patch-release.yml |
| 50 | + # Create a PR with the patches prepared |
| 51 | + - template: /eng/common/pipelines/templates/steps/create-pull-request.yml |
| 52 | + parameters: |
| 53 | + PRBranchName: prepare-patch-release-$(Build.BuildId) |
| 54 | + CommitMsg: "Patch release preparation" |
| 55 | + PRTitle: "Prepare patch release" |
| 56 | + CloseAfterOpenForTesting: '${{ parameters.TestPipeline }}' |
0 commit comments