From 03af1e775e9d9e5e2ae68583c3f1ac777eb21224 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 15 Jul 2024 07:50:11 +0200 Subject: [PATCH] refs #7442 Cache script --- image-cache.sh | 18 ++++++++++++++++++ push.sh => image-push.sh | 4 ++-- image.conf | 3 +++ push.conf | 2 -- semaphore/Dockerfile | 27 +++++++++++++-------------- 5 files changed, 36 insertions(+), 18 deletions(-) create mode 100755 image-cache.sh rename push.sh => image-push.sh (91%) create mode 100644 image.conf delete mode 100644 push.conf diff --git a/image-cache.sh b/image-cache.sh new file mode 100755 index 0000000..08e4a92 --- /dev/null +++ b/image-cache.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$MY_DIR/image.conf" + +image=$1 + +if [[ -z "$image" ]]; then + echo "Usage: $0 " + exit 1 +fi + +taggedImage="$registry/$image" + +docker image pull "$image" +docker image tag "$image" "$taggedImage" +docker image push "$taggedImage" diff --git a/push.sh b/image-push.sh similarity index 91% rename from push.sh rename to image-push.sh index 95ba774..7d14dec 100755 --- a/push.sh +++ b/image-push.sh @@ -2,7 +2,7 @@ set -e MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -source "$MY_DIR/push.conf" +source "$MY_DIR/image.conf" # Prepare the environment @@ -20,7 +20,7 @@ if [ ! -z "$revision" ]; then tag="$tag-$revisionPrefix$revision" fi -fullImage="$registry/$image" +fullImage="$registry/$repository/$image" latestImage="$fullImage:latest" taggedImage="$fullImage:$tag" diff --git a/image.conf b/image.conf new file mode 100644 index 0000000..f62e824 --- /dev/null +++ b/image.conf @@ -0,0 +1,3 @@ +registry="registry.verdnatura.es" +repository="verdnatura" +revisionPrefix="vn" diff --git a/push.conf b/push.conf deleted file mode 100644 index 307f46f..0000000 --- a/push.conf +++ /dev/null @@ -1,2 +0,0 @@ -registry="registry.verdnatura.es/verdnatura" -revisionPrefix="vn" diff --git a/semaphore/Dockerfile b/semaphore/Dockerfile index 7614b7b..eae047f 100644 --- a/semaphore/Dockerfile +++ b/semaphore/Dockerfile @@ -10,22 +10,21 @@ RUN pip install --upgrade pip \ pip install --upgrade pywinrm[credssp] #RUN apt-get update \ - # && apt-get upgrade -y \ - # && apt-get install -y --no-install-recommends \ - # gcc \ - # libffi-devel \ - # python3 \ - # epel-release \ - # python3-pip \ - # wget - +# && apt-get upgrade -y \ +# && apt-get install -y --no-install-recommends \ +# gcc \ +# libffi-devel \ +# python3 \ +# epel-release \ +# python3-pip \ +# wget #RUN pip3 install --upgrade pip \ - # pip3 install --upgrade virtualenv \ - # pip3 install pywinrm[kerberos] \ - # pip3 install pywinrm \ - # pip3 install jmspath \ - # pip3 install request prueba +# pip3 install --upgrade virtualenv \ +# pip3 install pywinrm[kerberos] \ +# pip3 install pywinrm \ +# pip3 install jmspath \ +# pip3 install request prueba RUN ls /usr/local/bin/