Skip to content
Snippets Groups Projects
Commit f1cde1ea authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'L2SS-225-rebuild_system_from_scratch.sh_does_not_work_on_test-lcu2' into 'master'

L2SS-225:  Fix rebuild_system_from_scratch.sh to also function on CentOS7

Closes L2SS-225

See merge request !41
parents a7879a5d 03cd9ad4
No related branches found
No related tags found
1 merge request!41L2SS-225: Fix rebuild_system_from_scratch.sh to also function on CentOS7
#! /usr/bin/env bash -e #! /usr/bin/env bash
HOME_DIR=${LOFAR20_DIR:-${PWD}} HOME_DIR=${LOFAR20_DIR:-${PWD}}
if [ ! -d ${HOME_DIR}/bootstrap ]; then if [ ! -d ${HOME_DIR}/bootstrap ]; then
...@@ -7,6 +7,25 @@ if [ ! -d ${HOME_DIR}/bootstrap ]; then ...@@ -7,6 +7,25 @@ if [ ! -d ${HOME_DIR}/bootstrap ]; then
exit 1 exit 1
fi fi
# Check if Docker compose can be found.
DOCKER_COMPOSE="docker compose version"
${DOCKER_COMPOSE} >&/dev/null
ret=${?}
if [ ${ret} -ne 0 ]; then
DOCKER_COMPOSE="docker-compose version"
${DOCKER_COMPOSE} >&/dev/null
ret=${?}
fi
if [ ${ret} -eq 0 ]; then
echo -e "\tFound Docker Compose: ${DOCKER_COMPOSE}"
else
echo -e "\tThis system appears to not have Docker compose installed. This means that the system cannot be rebuilt with this script."
return 1
fi
# Any error should terminate this script.
set -e
# Save for the moment when tango will be cloned. # Save for the moment when tango will be cloned.
OLD_HOME_DIR=${HOME_DIR}.old OLD_HOME_DIR=${HOME_DIR}.old
...@@ -30,7 +49,13 @@ function move_tango_dir_out_of_the_way() ...@@ -30,7 +49,13 @@ function move_tango_dir_out_of_the_way()
function remove_images() function remove_images()
{ {
${HOME_DIR}/bootstrap/sbin/delete_all_docker_images.sh YES_DELETE_ALL images="$(for i in $(docker images -q); do printf "%s " ${i}; done)"
if [ ${#images} -eq 0 ]; then
echo -e "\tThere are no images to delete."
else
echo -e "\tWill now delete the Docker images:"
docker rmi -f ${images}
fi
} }
function pull_tango() function pull_tango()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment