Decided the following requires wider devops discussion and shouldn't block having basic scheduled build (i.e. we're not doing this now):
In an ideal world, the images would be tagged with both the ucam-faas semantic release and an immutable tag that indicated the ucam-faas version and the parent base image version.
There's one thing that still needs to be clarified:
When doing the weekly job, do we only want to rerelease for the latest tag that we created?
If so, then this means that in the weekly pipeline, we have to determine what the latest tag is and run the job for that. I think there are two options that we can go for:
For each job that we have specified in our CI/CD pipeline we have to run a before_script that checks what the latest tag is and check the code out. Note that it only needs to do that when running the weekly scheduled pipeline. Possible issues are that this doesn't scale well: if a pipeline in a template gets updated and creates a new job, then we also need to override that in our pipeline.
We create a new job which is the only job being run during the weekly pipeline that determines what the latest tag is and then this job uses a pipeline trigger token in a curl call to kick off a new pipeline for that specific revision. Possible issue is that the pipeline trigger token is bound to a user.
Is this to stop it running more than weekly? I think we can live with that
It's to ensure that the job will run on the revision we want to run it on. That's because when setting up a pipeline schedule, you have to select a target branch or tag. It's static, so you can't select "last tag" (which is currently 0.7.1). So the best choice would probably be to select "main". But "main" might contain code that's unreleased and not tagged (as is currently the case for example). So we have to overwrite each job in the pipeline to check out the revision we want (last tag). Forget what I said, I just found out that we can write a global before_script which resolves the biggest problem of the first option.