Skip to content

Commit c74cb07

Browse files
committed
ci: add dry-run mode to production Azure Pipelines
1 parent 7487d70 commit c74cb07

5 files changed

+43
-10
lines changed

azure-pipelines.deprecate-package.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ variables:
2020
skipComponentGovernanceDetection: false
2121
- name: tags
2222
value: production,externalfacing
23+
- name: dryRun
24+
value: false
2325

2426
pool: '1ES-Host-Ubuntu'
2527

@@ -35,6 +37,11 @@ jobs:
3537
- template: .devops/templates/tools.yml@self
3638

3739
- script: |
38-
npm deprecate ${{ parameters.packageSpec }} "${{ parameters.message }}" --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmToken)
40+
echo "dry run mode enabled!"
41+
displayName: dry run mode notification
42+
condition: eq(variables.dryRun, true)
3943
44+
- script: |
45+
npm deprecate ${{ parameters.packageSpec }} "${{ parameters.message }}" --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmToken)
4046
displayName: 'Deprecate package'
47+
condition: eq(variables.dryRun, false)

azure-pipelines.hotfix.yml

+12-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ trigger: none
44

55
name: '$(targetNpmVersion) ($(Rev:r))'
66

7-
parameters:
8-
- name: isTestRun
9-
type: boolean
10-
default: false
11-
127
variables:
138
- template: .devops/templates/variables.yml
149
- name: tags
1510
value: production,externalfacing
11+
- name: dryRun
12+
type: boolean
13+
default: false
1614

1715
resources:
1816
repositories:
@@ -47,6 +45,11 @@ extends:
4745
steps:
4846
- template: .devops/templates/tools.yml@self
4947

48+
- script: |
49+
echo "dry run mode enabled!"
50+
displayName: dry run mode notification
51+
condition: eq(variables.dryRun, true)
52+
5053
- script: |
5154
node -e "if('$(targetNpmVersion)' === '') throw new Error('targetNpmVersion is not specified');"
5255
displayName: 'Checking for targetNpmVersion variable'
@@ -78,10 +81,10 @@ extends:
7881
displayName: 'Create tarball'
7982
workingDirectory: 'packages/react'
8083
81-
- ${{ if ne(parameters.isTestRun, true) }}:
82-
- script: |
83-
npm publish packages/react/react-$(targetNpmVersion).tgz --tag hf8 --//registry.npmjs.org/:_authToken=$(npmToken)
84-
displayName: Publish new version
84+
- script: |
85+
npm publish packages/react/react-$(targetNpmVersion).tgz --tag hf8 --//registry.npmjs.org/:_authToken=$(npmToken)
86+
displayName: Publish new version
87+
condition: eq(variables.dryRun, false)
8588
8689
- template: .devops/templates/cleanup.yml@self
8790
parameters:

azure-pipelines.release-vnext.yml

+11
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ variables:
1414
value: true
1515
- name: tags
1616
value: production,externalfacing
17+
- name: dryRun
18+
type: boolean
19+
default: false
1720

1821
# TODO set schedule once the pipeline is validated after a few manual releases
1922
# schedules:
@@ -58,6 +61,11 @@ extends:
5861
steps:
5962
- template: .devops/templates/tools.yml@self
6063

64+
- script: |
65+
echo "dry run mode enabled!"
66+
displayName: dry run mode notification
67+
condition: eq(variables.dryRun, true)
68+
6169
- script: |
6270
git config user.name "Fluent UI Build"
6371
git config user.email "[email protected]"
@@ -84,18 +92,21 @@ extends:
8492
- script: |
8593
node -r ./scripts/ts-node/src/register ./scripts/executors/src/deprecate-react-components-preview-packages.ts --token $(npmToken)
8694
displayName: 'Deprecate preview packages'
95+
condition: eq(variables.dryRun, false)
8796
8897
- script: |
8998
yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-vNext.config.js --message 'release: applying package updates - react-components'
9099
git reset --hard origin/master
91100
env:
92101
GITHUB_PAT: $(githubPAT)
93102
displayName: Publish changes and bump versions
103+
condition: eq(variables.dryRun, false)
94104
95105
- script: |
96106
node -r ./scripts/ts-node/src/register scripts/executors/src/tag-react-components.ts --token $(npmToken)
97107
displayName: Tag prelease packages with prerelease tag
98108
continueOnError: true
109+
condition: eq(variables.dryRun, false)
99110
100111
# Since releases are scoped, this should warn for any packages that were mistakenly not included in scoping
101112
- script: |

azure-pipelines.release.tools.yml

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ variables:
1212
skipComponentGovernanceDetection: false
1313
- name: tags
1414
value: production,externalfacing
15+
- name: dryRun
16+
type: boolean
17+
default: false
1518

1619
resources:
1720
repositories:
@@ -47,6 +50,11 @@ extends:
4750
steps:
4851
- template: .devops/templates/tools.yml@self
4952

53+
- script: |
54+
echo "dry run mode enabled!"
55+
displayName: dry run mode notification
56+
condition: eq(variables.dryRun, true)
57+
5058
- script: |
5159
git config user.name "Fluent UI Build"
5260
git config user.email "[email protected]"
@@ -76,6 +84,7 @@ extends:
7684
env:
7785
GITHUB_PAT: $(githubPAT)
7886
displayName: Publish changes and bump versions
87+
condition: eq(variables.dryRun, false)
7988
8089
- template: .devops/templates/cleanup.yml@self
8190
parameters:

azure-pipelines.release.web-components.yml

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ variables:
1414
value: true
1515
- name: tags
1616
value: production,externalfacing
17+
- name: dryRun
18+
type: boolean
19+
default: false
1720

1821
resources:
1922
repositories:

0 commit comments

Comments
 (0)