-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.startup.sh
executable file
·40 lines (33 loc) · 1.58 KB
/
ci.startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
# This script controls the startup of the container environment
# It can be used as an alternative to having docker-compose up started by the CI environment
BASEDIR=$(dirname $(readlink -f $0))
source $BASEDIR/set-env.sh
echo " ci.startup.sh == Printing the most important environment variables"
echo " MANIFEST: ${MANIFEST}"
echo " TESTS_IMAGE: ${TESTS_IMAGE}"
echo " JAHIA_IMAGE: ${JAHIA_IMAGE}"
echo " JAHIA_CLUSTER_ENABLED: ${JAHIA_CLUSTER_ENABLED}"
echo " NEXUS_USERNAME: ${NEXUS_USERNAME:0:3}***${NEXUS_USERNAME:(-6)}"
echo "$(date +'%d %B %Y - %k:%M') [LICENSE] == Check if license exists in env variable (JAHIA_LICENSE) =="
if [[ -z ${JAHIA_LICENSE} ]]; then
echo "$(date +'%d %B %Y - %k:%M') [LICENSE] == Jahia license does not exist, checking if there is a license file in /tmp/license.xml =="
if [[ -f /tmp/license.xml ]]; then
echo "$(date +'%d %B %Y - %k:%M') [LICENSE] == License found in /tmp/license.xml, base64ing it"
export JAHIA_LICENSE=$(base64 -i /tmp/license.xml)
else
echo "$(date +'%d %B %Y - %k:%M') [LICENSE] == STARTUP FAILURE, unable to find license =="
exit 1
fi
fi
echo "$(date +'%d %B %Y - %k:%M') == Cluster enabled: ${JAHIA_CLUSTER_ENABLED} =="
if [[ "${JAHIA_CLUSTER_ENABLED}" == "true" ]]; then
export CLUSTER_PROFILE="--profile cluster"
fi
echo "$(date +'%d %B %Y - %k:%M') == Starting environment =="
docker-compose up -d --renew-anon-volumes ${CLUSTER_PROFILE}
if [[ "$1" != "notests" ]]; then
docker ps -a
docker stats --no-stream
docker-compose up --abort-on-container-exit cypress
fi