3 ms·
This is definitely possible. We've been building an image in one phase and then running it in subsequent phases for years with gitlab. I think you are going ab
by JeremyNT 3y ago
This is definitely possible. We've been building an image in one phase and then running it in subsequent phases for years with gitlab.
I think you are going about this wrong. Are you generating an image tag dynamically? When you are tagging the image, make sure that you generate the tag deterministically based on information that is available to gitlab when the pipeline is created.
So for example, you could use the tag foo:$PIPELINE_ID instead of foo:$random
- codethief 3y agoMy apologies, I misspoke: I wanted the image tag not to be $CI_COMMIT_SHA but to be a hash dynamically generated from certain files in the repo. The issue is that IMAGE won't accept a dynamically generated environment variable (passed from job to job via a dotenv artifact).
- nijave 3y agoI think you could just jam anything you need in pipeline yaml from the dotenv file into outputs/variables then do something like this https://stackoverflow.com/a/71575683/2751619 https://stackoverflow.com/a/71575683/2751619
- codethief 3y agoNo, this doesn't work. Also note that the StackOverflow link is about Github Actions, not Gitlab CI.