-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] Use pipeline to update gather-docs.yaml during releases #7546
base: master
Are you sure you want to change the base?
Conversation
Maybe calling this script in core-build.yaml instead could be better? Then the condition would just be to run this script as long as the package publish step runs? I think I like that idea better than running the script in the release pipeline, but not entirely sold on either. |
const currentBranch = "refs/heads/release/1.2.x"; | ||
// Test for when file needs to be updated | ||
let filePath = createTempFile("should-change.txt", "branchName: refs/heads/release/0.0.x"); | ||
console.assert(checkFile(filePath, currentBranch) === true, "File should be updated"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe should check that the file contains the proper branch 'branchName: refs/heads/release/1.2.x'
|
||
function main() { | ||
const filePath = path.normalize("./common/config/azure-pipelines/templates/gather-docs.yaml") | ||
const currentBranch = process.env.CURRENT_BRANCH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add a quick sanity check here to make sure the new branchName also follows 'refs/heads/release/\d+.\d+.x/gi' before we update it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, this should be an easy way to make sure its not master branch or something
Use a script to find and replace the branchName in gather-docs.ymal file.
We would want to run this script whenever we publish build artifacts on a release branch, this is because the first time we build on a new release branch we target the previous release branch. Once that build publishes artifacts we want to update the yml file to the current release branch.
I created a new yaml file to trigger this, which runs every time we publish an artifact during the itwin.js builds. Don't know if this is the best way to call the script. Maybe just putting it at the end of the release pipeline which has a similar trigger, however that lives in the imodeljs-build-pipeline-scripts repo.