-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add document for using task migrations #1862
base: main
Are you sure you want to change the base?
Add document for using task migrations #1862
Conversation
STONEBLD-2829
Historically, task maintainers write `MIGRATION.md` to notify users what changes | ||
have to be made to the pipeline. This mechanism is not deprecated. Besides | ||
writing the file, it is also recommended to write a migration so that the | ||
updates can be applied to user pipelines automatically. |
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.
It would also be good to mention how the migration files get applied - i.e. link to the migration tool and the configuration that enables it in our Renovate deployment (Mintmaker)
|
||
Historically, task maintainers write `MIGRATION.md` to notify users what changes | ||
have to be made to the pipeline. This mechanism is not deprecated. Besides | ||
writing the file, it is also recommended to write a migration so that the |
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.
writing the file, it is also recommended to write a migration so that the | |
writing the document, it is also recommended to write a script so that the |
|
||
The migration file is a normal Bash script file. It should | ||
|
||
- Accept one argument. The pipeline file path is passed to via this argument. |
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.
We should also mention that this pipeline file is always a tekton Pipeline file. Even if the pipeline is defined inline in a PipelineRun file, the migration tool extracts the Pipeline from it and calls the migration script on the Pipeline.
This also means it's not possible to apply changes that would have to be done on the PipelineRun, e.g. changing the volumeClaimTemplate
for a workspace or things like that
- Be simple and small as much as possible. | ||
- Pass the `shellcheck` without customizing the default rules. | ||
|
||
Here are example script to create a migration for a task `task-a`: |
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.
Here are example script to create a migration for a task `task-a`: | |
Here are example steps to create a migration for a task `task-a`: |
(.spec.tasks[] | select(.name == "task-a") | .params) += | ||
{"name": "pipelinerun-name", "value": "\$(context.pipelineRun.name)"} |
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 make this example idempotent? (I.e. only add the param if it's not already there)
We should probably keep this open until the migration tool is ready for use? |
STONEBLD-2829