-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: step to check if a docker image exists #1077
feat: step to check if a docker image exists #1077
Conversation
It will check the Docker host first, and then will try a docker pull. If it fails, it will log an error
vars/checkDockerImage.groovy
Outdated
log(level: 'DEBUG', text: "${image} does not exist: pulling") | ||
if (cmd(returnStatus: true, script: "docker pull ${image}") == 0) { | ||
return | ||
} |
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.
What do you think to add a default new argument to try with pulling?
checkDockerImage(image: 'hello-world:latest', pull: true)
It can be enabled by default. Then this step can verify the cached docker images or also an image from an external docker registry.
Besides, do you wanna pull or just query if it's available?
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.
The bool return is in an upcoming commit!
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.
I just want to check. Maybe there is a simpler/faster manner
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
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.
Minor comments that are not blockers
I addressed them in last 4 commits, thanks! |
…notify-message-template * upstream/master: Fix build status and adjust Vault (#1074) Remove super-linter since it takes 20 minutes (#1083) Bump elastic stack version automation (#1081) feat: step to check if a docker image exists (#1077) docs: update CHANGELOG.md [maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare release v1.1.210 Enable stage filter argument for the beatsStages (#1076)
What does this PR do?
It adds a new step that will check if a given Docker image exists, checking the Docker host first: if that fails because the image does not exist in the current Docker host, then it will try to look up the manifest in the Docker registry. If it fails again then it means the image does not exist, it will log an error and will return false.
Why is it important?
We want to skip building Kibana again and again, if the image was already built. Specially important when we want to trigger an action on the same commit (i.e. triggering the e2e tests)