Skip to content

Commit 07d8024

Browse files
authored
Add INSTALL_RUN_RUSH_LOCKFILE_PATH to pipeline runs. (#5710)
1 parent b1a761f commit 07d8024

10 files changed

Lines changed: 5241 additions & 88 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
OS: windows-latest
3535
name: Node.js v${{ matrix.NodeVersionDisplayName }} (${{ matrix.OS }})
3636
runs-on: ${{ matrix.OS }}
37+
env:
38+
INSTALL_RUN_RUSH_LOCKFILE_PATH: ${{ github.workspace }}/repo-a/common/config/validation/rush-package-lock.json
3739
steps:
3840
- name: Create ~/.rush-user/settings.json
3941
shell: pwsh

common/config/azure-pipelines/npm-post-publish.yaml

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,31 @@ extends:
9696
- script: 'git config --local user.name Rushbot'
9797
displayName: 'git config name'
9898

99-
- script: 'node common/scripts/install-run-rush.js install --to repo-toolbox'
100-
displayName: 'Rush Install'
99+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
100+
parameters:
101+
Arguments: >
102+
install
103+
--to repo-toolbox
104+
DisplayName: 'Rush Install'
101105

102-
- script: 'node common/scripts/install-run-rush.js build --to repo-toolbox --verbose'
103-
displayName: 'Rush Build (repo-toolbox)'
106+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
107+
parameters:
108+
Arguments: >
109+
build
110+
--to repo-toolbox
111+
--verbose
112+
DisplayName: 'Rush Build (repo-toolbox)'
104113

105114
- script: 'node repo-scripts/repo-toolbox/lib-commonjs/start.js bump-decoupled-local-dependencies'
106115
displayName: 'Bump decoupled local dependencies'
107116

108-
- script: 'node common/scripts/install-run-rush.js update'
109-
displayName: 'Rush Update'
117+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
118+
parameters:
119+
Arguments: 'update'
120+
DisplayName: 'Rush Update'
121+
122+
- bash: cp common/temp/install-run/@microsoft+rush@*/package-lock.json common/config/validation/rush-package-lock.json
123+
displayName: 'Update rush-package-lock.json'
110124

111125
- bash: |
112126
set -e
@@ -124,15 +138,15 @@ extends:
124138
git commit -m "$(CommitMessage)"
125139
displayName: 'Commit dependency changes'
126140
127-
- bash: |
128-
set -e
129-
130-
node common/scripts/install-run-rush.js change \
131-
--bulk \
132-
--bump-type none \
141+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
142+
parameters:
143+
Arguments: >
144+
change
145+
--bulk
146+
--bump-type none
133147
--commit-message "chore: generate change files for decoupled dependency bump"
134-
displayName: 'Generate change files'
135-
condition: and(succeeded(), eq(variables.HasChanges, 'true'))
148+
DisplayName: 'Generate change files'
149+
Condition: "and(succeeded(), eq(variables.HasChanges, 'true'))"
136150

137151
- template: /common/config/azure-pipelines/templates/push-and-create-github-pr.yaml@self
138152
parameters:
@@ -163,13 +177,18 @@ extends:
163177
parameters:
164178
NodeMajorVersion: 24
165179

166-
# Build the custom Docusaurus plugin for api-documenter in the
167-
# rushstack-websites repo.
168-
- script: 'node common/scripts/install-run-rush.js install'
169-
displayName: 'Rush Install (rushstack-websites)'
180+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
181+
parameters:
182+
Arguments: 'install'
183+
DisplayName: 'Rush Install (rushstack-websites)'
170184

171-
- script: 'node common/scripts/install-run-rush.js build --to-except api.rushstack.io --verbose'
172-
displayName: 'Rush Build to-except api.rushstack.io (rushstack-websites)'
185+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
186+
parameters:
187+
Arguments: >
188+
build
189+
--to-except api.rushstack.io
190+
--verbose
191+
DisplayName: 'Rush Build to-except api.rushstack.io (rushstack-websites)'
173192

174193
# Download the api artifact from the triggering publish pipeline.
175194
# AzDO automatically resolves which pipeline resource triggered this run.

common/config/azure-pipelines/templates/build.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,31 @@ steps:
1010
- script: 'git config --local user.name Rushbot'
1111
displayName: 'git config name'
1212

13-
- script: 'node common/scripts/install-run-rush.js change --verify'
14-
displayName: 'Verify Change Logs'
13+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
14+
parameters:
15+
Arguments: >
16+
change
17+
--verify
18+
DisplayName: 'Verify Change Logs'
1519

16-
- script: 'node common/scripts/install-run-rush.js install'
17-
displayName: 'Rush Install'
20+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
21+
parameters:
22+
Arguments: 'install'
23+
DisplayName: 'Rush Install'
1824

1925
# - bash: |
2026
# /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
2127
# echo ">>> Started xvfb"
2228
# displayName: Start xvfb
2329
# condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
2430

25-
- script: 'node common/scripts/install-run-rush.js retest --verbose --production ${{ parameters.BuildParameters }}'
26-
displayName: 'Rush retest (install-run-rush)'
31+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
32+
parameters:
33+
Arguments: >
34+
retest
35+
--verbose
36+
--production ${{ parameters.BuildParameters }}
37+
DisplayName: 'Rush retest (install-run-rush)'
2738

2839
- script: 'npm run test'
2940
workingDirectory: 'build-tests/rush-package-manager-integration-test'

common/config/azure-pipelines/templates/bump-versions.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@ parameters:
66
default: $(Build.SourceBranchName)
77

88
steps:
9-
- script: 'node common/scripts/install-run-rush.js version --bump --version-policy ${{ parameters.VersionPolicyName }} --target-branch ${{ parameters.BranchName }}'
10-
displayName: 'Rush Version (Policy: ${{ parameters.VersionPolicyName }})'
9+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
10+
parameters:
11+
Arguments: >
12+
version
13+
--bump
14+
--version-policy ${{ parameters.VersionPolicyName }}
15+
--target-branch ${{ parameters.BranchName }}
16+
DisplayName: 'Rush Version (Policy: ${{ parameters.VersionPolicyName }})'
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Runs install-run-rush.js with the specified CLI arguments and sets the
2+
# INSTALL_RUN_RUSH_LOCKFILE_PATH environment variable.
3+
parameters:
4+
- name: Arguments
5+
type: string
6+
- name: DisplayName
7+
type: string
8+
- name: Condition
9+
type: string
10+
default: ''
11+
- name: NpmAuthToken
12+
type: string
13+
default: ''
14+
- name: RepoPath
15+
type: string
16+
default: '$(Build.SourcesDirectory)'
17+
18+
steps:
19+
- script: 'node common/scripts/install-run-rush.js ${{ parameters.Arguments }}'
20+
displayName: '${{ parameters.DisplayName }}'
21+
workingDirectory: ${{ parameters.RepoPath }}
22+
${{ if ne(parameters.Condition, '') }}:
23+
condition: ${{ parameters.Condition }}
24+
env:
25+
INSTALL_RUN_RUSH_LOCKFILE_PATH: ${{ parameters.RepoPath }}/common/config/validation/rush-package-lock.json
26+
${{ if ne(parameters.NpmAuthToken, '') }}:
27+
NPM_AUTH_TOKEN: ${{ parameters.NpmAuthToken }}
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
steps:
2-
- script: 'node common/scripts/install-run-rush.js publish --publish --pack --include-all --release-folder $(Build.ArtifactStagingDirectory)/packages'
3-
displayName: 'Rush Pack'
2+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
3+
parameters:
4+
Arguments: >
5+
publish
6+
--publish
7+
--pack
8+
--include-all
9+
--release-folder $(Build.ArtifactStagingDirectory)/packages
10+
DisplayName: 'Rush Pack'
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
steps:
2-
- script: 'node repo-scripts/repo-toolbox/lib-commonjs/start.js record-versions --out-file $(Build.ArtifactStagingDirectory)/published-versions/published-versions.json'
2+
- script: >
3+
node repo-scripts/repo-toolbox/lib-commonjs/start.js record-versions
4+
--out-file $(Build.ArtifactStagingDirectory)/published-versions/published-versions.json
35
displayName: 'Record Published Versions'
4-
- script: 'node repo-scripts/repo-toolbox/lib-commonjs/start.js collect-project-files --subfolder temp/json-schemas --output-path $(Build.ArtifactStagingDirectory)/json-schemas'
6+
7+
- script: >
8+
node repo-scripts/repo-toolbox/lib-commonjs/start.js collect-project-files
9+
--subfolder temp/json-schemas
10+
--output-path $(Build.ArtifactStagingDirectory)/json-schemas
511
displayName: 'Collect JSON Schemas'
6-
- script: 'node repo-scripts/repo-toolbox/lib-commonjs/start.js collect-project-files --subfolder temp/api --output-path $(Build.ArtifactStagingDirectory)/api'
12+
13+
- script: >
14+
node repo-scripts/repo-toolbox/lib-commonjs/start.js collect-project-files
15+
--subfolder temp/api
16+
--output-path $(Build.ArtifactStagingDirectory)/api
717
displayName: 'Collect API review files'

common/config/azure-pipelines/templates/publish.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ parameters:
66
default: $(Build.SourceBranchName)
77

88
steps:
9-
- script: 'node common/scripts/install-run-rush.js publish --apply --publish --include-all --target-branch ${{ parameters.BranchName }} --add-commit-details --set-access-level public'
10-
displayName: 'Rush Publish (Policy: ${{ parameters.VersionPolicyName }})'
11-
env:
12-
NPM_AUTH_TOKEN: $(npmToken)
9+
- template: /common/config/azure-pipelines/templates/install-run-rush.yaml@self
10+
parameters:
11+
Arguments: >
12+
publish
13+
--apply
14+
--publish
15+
--include-all
16+
--target-branch ${{ parameters.BranchName }}
17+
--add-commit-details --set-access-level public
18+
DisplayName: 'Rush Publish (Policy: ${{ parameters.VersionPolicyName }})'
19+
NpmAuthToken: $(npmToken)

0 commit comments

Comments
 (0)