Skip to content
Snippets Groups Projects
Commit f27c14a9 authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-205: Build and push images for several services

parent 617d1a04
No related branches found
No related tags found
1 merge request!183Docker image building & pushing with CI pipeline caching
......@@ -20,7 +20,7 @@ volumes:
services:
pogo:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-pogo:${TANGO_POGO_VERSION}
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-pogo:${TANGO_POGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}pogo
networks:
- control
......
......@@ -13,7 +13,7 @@ version: '2'
services:
rest:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-rest:${TANGO_REST_VERSION}
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-rest:${TANGO_REST_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}tango-rest
networks:
- control
......
......@@ -15,7 +15,7 @@ volumes:
services:
tangodb:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-db:${TANGO_DB_VERSION}
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-db:${TANGO_DB_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}tangodb
networks:
- control
......@@ -37,7 +37,7 @@ services:
restart: unless-stopped
databaseds:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-cpp:${TANGO_CPP_VERSION}
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-cpp:${TANGO_CPP_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}databaseds
networks:
- control
......
......@@ -11,7 +11,7 @@ version: '2'
services:
tangotest:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-java:${TANGO_JAVA_VERSION}
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-java:${TANGO_JAVA_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}tangotest
networks:
- control
......
......@@ -15,6 +15,7 @@ fi
. "${LOFAR20_DIR}/docker-compose/.env" || exit 1
# Array of tuples separated by space inside double quotes
# These images are downloaded from a remote registry and pushed locally
REMOTE_IMAGES=(
"tango-dsconfig ${TANGO_DSCONFIG_VERSION}" "tango-java ${TANGO_JAVA_VERSION}"
"tango-itango ${TANGO_ITANGO_VERSION}" "tango-pogo ${TANGO_POGO_VERSION}"
......@@ -22,6 +23,9 @@ REMOTE_IMAGES=(
"tango-dsconfig ${TANGO_DSCONFIG_VERSION}" "tango-rest ${TANGO_REST_VERSION}"
)
# If first argument of bash script not set run first stage
if [ -z "${1+x}" ]; then
# Iterate over al the REMOTE_IMAGES and pull them from remote and push local
for image in "${REMOTE_IMAGES[@]}"; do
# Set, splits tuple into $1 and $2
# shellcheck disable=SC2086
......@@ -32,38 +36,29 @@ for image in "${REMOTE_IMAGES[@]}"; do
docker tag "${remote_url}" "${local_url}"
docker push "${local_url}"
done
fi
# docker pull "${SKA_REPO}-${image}:"
# Tuple of images and queries to detect changes
# TODO(Corne): Have this list generated from the .yml files
LOCAL_IMAGES=(
"elk" "elk-configure-host" "grafana" "prometheus" "lofar-device-base"
"docker-compose_jupyter" "docker-compose_integration-test"
"docker-compose_itango" "docker-compose_tango-prometheus-exporter"
)
## Compile a list of the SKA images
#SKA_IMAGES=$(for i in $(docker images | grep -E ${DOCKER_TAG} | grep -E ${SKA_REPO} | cut -d' ' -f1); do printf "%s " "${i}"; done)
#
## Compile a list of LOFAR2.0 images
#LOFAR_IMAGES=$(for i in $(docker images | grep -E ${DOCKER_TAG} | grep -E -v "${SKA_REPO}|${LOFAR_REPO}" | cut -d' ' -f1); do printf "%s " "${i}"; done)
#
#echo "$SKA_IMAGES"
#echo "$LOFAR_IMAGES"
# If first argument set run second stage, determine LOCAL_IMAGE to build and
# push from the argument
if [ ! -z "${1+x}" ]; then
#function tag_and_push()
#{
# (
# docker tag "${1}" "${2}"
# docker push "${2}"
# ) &
#}
#
## Rename the SKA images for the LOFAR2.0 repo
## and push them to the LOFAR2.0 repo
#for IMAGE in ${SKA_IMAGES}; do
# PUSH_IMAGE=${IMAGE//${SKA_REPO}/${LOFAR_REPO}}:${VERSION}
# tag_and_push "${IMAGE}" "${PUSH_IMAGE}"
#done
#
## Rename the LOFAR2.0 images for the LOFAR2.0 repo
## and push them to the LOFAR2.0 repo
#for IMAGE in ${LOFAR_IMAGES}; do
# PUSH_IMAGE=${LOFAR_REPO}/${IMAGE}:${VERSION}
# tag_and_push "${IMAGE}" "${PUSH_IMAGE}"
#done
cd "${LOFAR20_DIR}/docker-compose" || exit 1
# wait
for image in "${LOCAL_IMAGES[@]}"; do
if [ "${1}" == "${image}" ]; then
make build "${image}"
local_url="${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/${image}:latest"
docker tag "${image}" "${local_url}"
docker push "${local_url}"
fi
done
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment