diff --git a/images/docker-host/Dockerfile b/images/docker-host/Dockerfile index 6b9e860b33..5f088c36c6 100644 --- a/images/docker-host/Dockerfile +++ b/images/docker-host/Dockerfile @@ -34,6 +34,7 @@ ENV DOCKER_HOST=docker-host \ RUN fix-permissions /home COPY update-push-images.sh /update-push-images.sh +COPY update-images.sh /update-images.sh COPY prune-images.sh /prune-images.sh COPY remove-exited.sh /remove-exited.sh diff --git a/images/docker-host/update-images.sh b/images/docker-host/update-images.sh new file mode 100755 index 0000000000..0de8fbba86 --- /dev/null +++ b/images/docker-host/update-images.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e +set -x + +if ! docker -H ${DOCKER_HOST} info &> /dev/null; then + echo "could not connect to ${DOCKER_HOST}"; exit 1 +fi + +# Iterates through all images that have the name of the repository we are interested in in it +for FULL_IMAGE in $(docker image ls --format "{{.Repository}}:{{.Tag}}" | grep -E "${REPOSITORY_TO_UPDATE}/" | grep -v none); do + # pull newest version of found image + docker pull ${FULL_IMAGE} | cat +done diff --git a/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh b/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh index cce646dfbf..be4fdcc10d 100755 --- a/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh +++ b/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh @@ -1366,3 +1366,15 @@ if [ "${LAGOON_POSTROLLOUT_DISABLED}" != "true" ]; then else echo "post-rollout tasks are currently disabled LAGOON_POSTROLLOUT_DISABLED is set to true" fi + +############################################## +### PUSH the latest .lagoon.yml into lagoon-yaml configmap +############################################## + +if kubectl --insecure-skip-tls-verify -n ${NAMESPACE} get configmap lagoon-yaml &> /dev/null; then + # replace it + kubectl --insecure-skip-tls-verify -n ${NAMESPACE} create configmap lagoon-yaml --from-file=.lagoon.yml -o yaml --dry-run | kubectl replace -f - +else + # create it + kubectl --insecure-skip-tls-verify -n ${NAMESPACE} create configmap lagoon-yaml --from-file=.lagoon.yml +fi diff --git a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh index f6fd3fea3d..d9820eef4e 100755 --- a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh +++ b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh @@ -1364,3 +1364,15 @@ if [ "${LAGOON_POSTROLLOUT_DISABLED}" != "true" ]; then else echo "post-rollout tasks are currently disabled LAGOON_POSTROLLOUT_DISABLED is set to true" fi + +############################################## +### PUSH the latest .lagoon.yml into lagoon-yaml configmap +############################################## + +if oc --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} get configmap lagoon-yaml &> /dev/null; then + # replace it + oc --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} create configmap lagoon-yaml --from-file=.lagoon.yml -o yaml --dry-run | oc replace -f - +else + # create it + oc --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} create configmap lagoon-yaml --from-file=.lagoon.yml +fi