Skip to content
Snippets Groups Projects
Commit b07b944a authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update docker init

parent 43938e27
No related branches found
No related tags found
1 merge request!72OP#7651 CI Server: beide AWX ansteuerbar machen https://projects.iml.unibe.ch/work_packages/7651
......@@ -29,10 +29,14 @@
# 2024-10-30 v1.22 <axel.hahn@unibe.ch> added: Open Mysql client in container
# 2024-10-30 v1.23 <axel.hahn@unibe.ch> added: show menu hints why some menu items are visible
# 2024-11-20 v1.24 <axel.hahn@unibe.ch> fix menu with started database less app; apply template permissions on target file; add $WEBURL; remove $frontendurl
# 2024-11-20 v1.25 <axel.hahn@unibe.ch> fix menu startup containers
# 2024-11-21 v1.26 <axel.hahn@unibe.ch> Reset colors in _checkConfig
# ======================================================================
cd "$( dirname "$0" )" || exit 1
_version="1.26"
# init used vars
gittarget=
WEBURL=
......@@ -42,7 +46,6 @@ _self=$( basename "$0" )
# shellcheck source=/dev/null
. "${_self}.cfg" || exit 1
_version="1.24"
# git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git
selfgitrepo="docker-php-starterkit.git"
......@@ -60,6 +63,7 @@ fgReset="\e[0m"
# running containers
DC_WEB_UP=0
DC_DB_UP=0
DC_ALL_UP=0
# repo of docker-php-starterkit is here?
DC_REPO=1
......@@ -84,11 +88,11 @@ function _checkConfig(){
# --- v1.24
if [ -z "$WEBURL" ]; then
echo -e "${fgBrown}INFO: add 'WEBURL=\"/\"' in your ${_self}.cfg. It is a new var since v1.24"
echo -e "${fgBrown}INFO: add 'WEBURL=\"/\"' in your ${_self}.cfg. It is a new var since v1.24${fgReset}"
WEBURL="/"
fi
if [ -n "$frontendurl" ]; then
echo "INFO: Remove frontendurl=$frontendurl in your ${_self}.cfg. It is obsolete since v1.24"
echo -e "${fgBrown}INFO: Remove frontendurl=$frontendurl in your ${_self}.cfg. It is obsolete since v1.24${fgReset}"
fi
}
......@@ -119,6 +123,8 @@ function _getStatus_docker(){
DC_WEB_UP=0
DC_DB_UP=0
DC_ALL_UP=0
grep -q "${APP_NAME}-server" <<< "$_out" && DC_WEB_UP=1
grep -q "${APP_NAME}-db" <<< "$_out" && DC_DB_UP=1
......@@ -128,6 +134,14 @@ function _getStatus_docker(){
return
fi
if [ "${DC_WEB_UP}" = "1" ] && [ "${DC_DB_UP}" = "1" ]; then
DC_ALL_UP=1
fi
if [ "$DB_ADD" = "false" ] && [ "${DC_WEB_UP}" = "1" ]; then
DC_ALL_UP=1
fi
}
# Get web url of the application
......@@ -204,9 +218,7 @@ function showMenu(){
echo "${_spacer}$( _key T ) - remove generated files"
echo
fi
if [ $DC_WEB_UP -eq 0 ] \
|| [ $DC_DB_UP -eq 0 ] && [ ! "$DB_ADD" = "false" ] \
|| [ $_bAll -eq 1 \
if [ $DC_ALL_UP -eq 0 ] || [ $_bAll -eq 1 \
]; then
if [ $DC_CONFIG_CHANGED -eq 0 ] || [ $_bAll -eq 1 ]; then
menuhint $_bAll "A container is down and config is unchanged"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment