I am building a docker container, running tests on the code, pushing the container to Amazon’s ECR, then deploying to Amazon’s EKS. Sometimes we do not want to deploy the container right away. Rather than re-build/test/push a new container that’s identical to the previous one, I’m looking to run a script to check to see if a container exists with my SHA1 and just deploy that.
Workflow with deployment where container doesn’t exist yet:
Script to check if the container exists > build/test > push container to ECR > deploy container to EKS
Workflow with deployment where container does exist:
Script to check if the container exists > deploy container to EKS
Is this at all possible? The script could return a simple true/false or something else, whatever would be more useful. I’ve looked at the documentation as well as a bunch of discussions here, and I haven’t stumbled upon a way to accomplish this. The problem I run into is that conditionals for workflows/jobs are determined before any scripts can run, and there doesn’t seem to be a way around that.