Closed robwhitby closed 5 years ago
new behaviour:
For now the new behaviour is only enabled for pipelines in team engineering-enablement
for testing.
I am pausing this for a bit because concourse team are working on more improvements to pinning.
ok I have ditched using pinning completely because it wasn't quite the right fit. Pinning means only one version
is active at a time. We don't really want this, because it means every time we pin we would stop an older run from proceeding, and unpinning is risky because it might cause an old build to trigger.
Instead of pinning I have gone back to using the enable/disable feature of versions, but have simplified how it works so we make less api calls and never enable
old versions like it did before.
Pause the pipeline. We might be about to change the pipeline, so stop new builds triggering until we're finished.
Run halfpipe upload
If we just changed the pipeline, disable all older versions. This prevents any new jobs triggering immediately with a previous version.
Unpause the pipeline.
Currently this is enabled for pipelines in the engineering-enablement
team
A simpler beta version is now running for engineering-enablement
pipelines. No more pausing/unpausing on every run.
If the pipeline has changed:
Disable all versions except the current version. This prevents any new jobs we are about to create from triggering immediately with a previous version.
Update the pipeline.
At the moment the update-pipeline job does the following:
This means that if the pipeline has changed, only the new version is left enabled. This prevents new jobs running against old versions (e.g. if you add a deploy to live stage it won't run against an old version).
If the pipeline has not changed, we re-enable old versions because otherwise a previous version "in progress" will not continue to the next jobs.
Now that Concourse has the concept of 'pinning' resources, we can instead pin the version to the latest and then un-pin if the pipeline has not changed.
Update job runs this script: https://github.com/springernature/halfpipe-update/blob/master/halfpipe-update-docker/update-pipeline