Use a manual job to trigger a selective build/push

This commit is contained in:
Kamil Trzciński 2021-02-02 13:30:18 +01:00
parent a9204d345d
commit 3acad93b15
4 changed files with 34 additions and 61 deletions

View file

@ -1,25 +0,0 @@
function image_already_exists() {
image=$1
$(docker pull $image > /dev/null)
}
function build_if_needed() {
image=$1
if ! image_already_exists $image; then
docker build -t "$image" -f "Dockerfile.$image" .
else
echo "$image already exists, skipping build."
fi
}
function push_if_needed() {
image=$1
if ! image_already_exists $image; then
docker push "$image"
else
echo "$image already exists, skipping push."
fi
}