Skip to content

Commit

Permalink
chore(ci): add druRun mode to production AP
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrokirpa committed Jan 30, 2025
1 parent 678529c commit ab8563a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 28 deletions.
6 changes: 6 additions & 0 deletions .devops/templates/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ steps:
echo number of CPUs "$(getconf _NPROCESSORS_ONLN)"
displayName: Log environment variables (Linux)
condition: eq(variables['Agent.OS'], 'Linux')
# Logs a message when dry run mode is enabled.
- script: |
echo "dry run mode enabled!"
displayName: dry run mode notification
condition: eq(variables.dryRun, true)
3 changes: 3 additions & 0 deletions .devops/templates/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ variables:
deployBasePath: ${{ coalesce(parameters.deployBasePath, replace(variables['Build.SourceBranch'], 'refs/', '')) }}

skipComponentGovernanceDetection: ${{ parameters.skipComponentGovernanceDetection }}

# Dry run mode for testing the pipeline without making changes
dryRun: false
2 changes: 1 addition & 1 deletion azure-pipelines.deprecate-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ jobs:

- script: |
npm deprecate ${{ parameters.packageSpec }} "${{ parameters.message }}" --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmToken)
displayName: 'Deprecate package'
condition: eq(variables.dryRun, false)
13 changes: 4 additions & 9 deletions azure-pipelines.hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ trigger: none

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

parameters:
- name: isTestRun
type: boolean
default: false

variables:
- template: .devops/templates/variables.yml
- name: tags
Expand Down Expand Up @@ -78,10 +73,10 @@ extends:
displayName: 'Create tarball'
workingDirectory: 'packages/react'
- ${{ if ne(parameters.isTestRun, true) }}:
- script: |
npm publish packages/react/react-$(targetNpmVersion).tgz --tag hf8 --//registry.npmjs.org/:_authToken=$(npmToken)
displayName: Publish new version
- script: |
npm publish packages/react/react-$(targetNpmVersion).tgz --tag hf8 --//registry.npmjs.org/:_authToken=$(npmToken)
displayName: Publish new version
condition: eq(variables.dryRun, false)
- template: .devops/templates/cleanup.yml@self
parameters:
Expand Down
12 changes: 0 additions & 12 deletions azure-pipelines.release-fluentui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ variables:
value: production,externalfacing

# below are variables configurable at queue time, so they cannot appear in yml file
# - name: dryRun # set it to true in order to execute publishing in dry run mode - nothing will be published
# value: false
# - name: publishDocsiteOnly # set it to true to only run Job_build_publish_doc
# value: false
# - name: publishOfficial # set it to true to publish package to npm, and publish docsite for official releases
Expand Down Expand Up @@ -59,11 +57,6 @@ extends:
steps:
- template: .devops/templates/tools.yml@self

- script: |
echo "dry run mode enabled!"
displayName: dry run mode notification
condition: eq(variables.dryRun, true)
- script: |
git config user.name "Fluent UI Build"
git config user.email "[email protected]"
Expand Down Expand Up @@ -122,11 +115,6 @@ extends:
steps:
- template: .devops/templates/tools.yml@self

- script: |
echo "dry run mode enabled!"
displayName: dry run mode notification
condition: eq(variables.dryRun, true)
- task: CmdLine@2
displayName: Checkout branch for pull
condition: and(succeeded(), eq(variables.publishOfficial, true))
Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines.release-vnext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,21 @@ extends:
- script: |
node -r ./scripts/ts-node/src/register ./scripts/executors/src/deprecate-react-components-preview-packages.ts --token $(npmToken)
displayName: 'Deprecate preview packages'
condition: eq(variables.dryRun, false)
- script: |
yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-vNext.config.js --message 'release: applying package updates - react-components'
git reset --hard origin/master
env:
GITHUB_PAT: $(githubPAT)
displayName: Publish changes and bump versions
condition: eq(variables.dryRun, false)
- script: |
node -r ./scripts/ts-node/src/register scripts/executors/src/tag-react-components.ts --token $(npmToken)
displayName: Tag prelease packages with prerelease tag
continueOnError: true
condition: eq(variables.dryRun, false)
# Since releases are scoped, this should warn for any packages that were mistakenly not included in scoping
- script: |
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.release.tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ extends:
env:
GITHUB_PAT: $(githubPAT)
displayName: Publish changes and bump versions
condition: eq(variables.dryRun, false)
- template: .devops/templates/cleanup.yml@self
parameters:
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.release.web-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ extends:
env:
GITHUB_PAT: $(githubPAT)
displayName: Publish changes and bump versions
condition: eq(variables.dryRun, false)
- template: .devops/templates/cleanup.yml@self
parameters:
Expand Down
8 changes: 2 additions & 6 deletions azure-pipelines.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ variables:
- name: tags
value: production,externalfacing

# below are variables configurable at queue time, so they cannot appear in yml file
# - name: skipPublish # set it to true in order to skip publishing to NPM. Useful for deploying docsite only updates.
# value: false

schedules:
# minute 0, hour 7 in UTC (11pm in UTC-8), any day of month, any month, days 1-5 of week (M-F)
# https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?tabs=yaml&view=azure-devops#supported-cron-syntax
Expand Down Expand Up @@ -128,7 +124,7 @@ extends:
- script: |
yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-v8.config.js --message 'release: applying package updates - react v8'
git reset --hard origin/master
condition: eq(variables.skipPublish, false)
condition: eq(variables.dryRun, false)
env:
GITHUB_PAT: $(githubPAT)
displayName: Publish changes and bump versions
Expand Down Expand Up @@ -167,7 +163,7 @@ extends:
# failure doesn't need to block anything else
- script: |
node -r ./scripts/ts-node/src/register ./scripts/update-release-notes/src/index.ts --token=$(githubPAT) --apply --debug
condition: eq(variables.skipPublish, false)
condition: eq(variables.dryRun, false)
displayName: 'Update github release notes'
- template: .devops/templates/cleanup.yml@self
Expand Down

0 comments on commit ab8563a

Please sign in to comment.