-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathadt-dev.sh
executable file
·136 lines (107 loc) · 6.22 KB
/
adt-dev.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/bin/bash -eu
# #############################################################################
# Initialize
# #############################################################################
SCRIPT_NAME="${0##*/}"
SCRIPT_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "# ############################################################################## #"
echo "# Acceptance Development Mode #"
echo "# ############################################################################## #"
#
# Usage message
#
print_usage_dev() {
cat << EOF
usage: $0 <action> [ -n PRODUCT_NAME -v PRODUCT_VERSION [ -a ADDONS ] -d DATABASE_TYPE:VERSION -p PORT_PREFIX [ -c ] [ -i INSTANCE_ID ] ]
This script manages automated deployment of eXo products for testing purpose.
Action
------
deploy Deploys (Download+Configure) the server
download-dataset Downloads the dataset required by the server
start Starts the server
stop Stops the server
restart Restarts the server
undeploy Undeploys (deletes) the server
start-all Starts all deployed servers
stop-all Stops all deployed servers
restart-all Restarts all deployed servers
undeploy-all Undeploys (deletes) all deployed servers
list Lists all deployed servers
init Initializes the environment
update-repos Update Git repositories used by the web front-end
web-server Starts a local PHP web server to test the front-end (requires PHP >= 5.4). It automatically activates the development mode.
Instance Settings
=================
-n PRODUCT_NAME : The product you want to manage. Possible values are :
gatein GateIn Community edition - Apache Tomcat bundle
exogtn GateIn eXo edition - Apache Tomcat bundle
plf eXo Platform Standard Edition - Apache Tomcat bundle
plfcom eXo Platform Community Edition - Apache Tomcat bundle
plfent eXo Platform Express/Enterprise Edition - Apache Tomcat bundle
plfenteap eXo Platform Express/Enterprise Edition - JBoss EAP bundle
plfsales eXo Platform Enterprise Edition - Apache Tomcat bundle for Sales
plftrial eXo Platform Trial Edition - Apache Tomcat bundle
plfdemo eXo Platform Demo Edition - Apache Tomcat bundle
addonchat eXo Platform + eXo Addon Chat - Apache Tomcat bundle
compint eXo Company Intranet - Apache Tomcat bundle
community eXo Community Website - Apache Tomcat bundle
docs eXo Platform Documentations Website - Apache Tomcat bundle
-v PRODUCT_VERSION : The version of the product. Can be either a release, a snapshot (the latest one) or a timestamped snapshot
-p PORT_PREFIX : The prefix for all the ports used. Must be unique for all deployments on a server (ex: 400)
-a ADDONS : The comma separated list of add-ons to deploy (ex: exo-site-templates:1.0.0,exo-sdp-demo:1.0.x-SNAPSHOT)
-C ADDONS_CATALOG : The add-on manager catalog url to use
-d DATABASE_TYPE:VERSION : The database type + his version separated with a : char. Possible values are :
HSQLDB
DOCKER_MYSQL:5.7 / DOCKER_MYSQL:5.6 / DOCKER_MYSQL:5.5
DOCKER_POSTGRES:9.6 / DOCKER_POSTGRES:9.5 / DOCKER_POSTGRES:9.4
DOCKER_MARIADB:5.5 / DOCKER_MARIADB:5 / DOCKER_MARIADB:10.0 / DOCKER_MARIADB:10.1 / DOCKER_MARIADB:10
DOCKER_ORACLE:12cR1_plf (pre initialized database)
DOCKER_SQLSERVER:2017-CU2
-c : Configure mongodb for the Chat
-i INSTANCE_ID : Add an ID to the instance to be able to deploy several time the same version
-l LABELS : Comma separated list of labels for the deployment. Known values are :
company All the company deployement like Tribe / Blog / Website / Buy page / ...
translation Translation deployment
doc Documentation deployment
fb Feature Branch deployment
maintenance Maintenance deployment
sales eXo Sales deployment for each Sales Team guy
sales-demo Demo for lead evaluation requested by eXo Sales Team
examples
=================
# List deployed servers
./adt-dev.sh list
# Deploy eXo Platform Enterprise 4.4.0 on MySQL 5.7
./adt-dev.sh deploy -n plfent -v 4.4.0 -p 200 -d DOCKER_MYSQL:5.7
# Deploy eXo Platform Enterprise 4.4.0 on MariaDB 10
./adt-dev.sh deploy -n plfent -v 4.4.0 -p 200 -d DOCKER_MARIADB:10
# Undeploy eXo Platform Enterprise 4.4.0 on MySQL 5.7
./adt-dev.sh undeploy-all -n plfent -v 4.4.0 -p 200 -d DOCKER_MYSQL:5.7
EOF
}
#print_header_dev
# if no parameters : print help
if [ $# == 0 ]; then print_usage_dev; exit 1; fi
ACTION=$1
shift
# if 1st parameter start with "-" character : print help
if [ "${ACTION:0:1}" = "-" ]; then echo "The first parameter must be an ACTION"; print_usage_dev; exit 1; fi
while getopts "n:v:a:C:d:p:ci:l:h" OPTION; do
case $OPTION in
n) export PRODUCT_NAME=$OPTARG; echo "## NAME = $OPTARG";;
v) export PRODUCT_VERSION=$OPTARG; echo "## VERSION = $OPTARG";;
a) export DEPLOYMENT_ADDONS=$OPTARG; echo "## ADDONS = $OPTARG";;
C) export DEPLOYMENT_ADDONS_CATALOG=$OPTARG; echo "## ADDONS CATALOG = $OPTARG";;
d) export DEPLOYMENT_DB_TYPE=$(echo "${OPTARG}" | cut -f1 -d':'); echo "## DATABASE TYPE = ${DEPLOYMENT_DB_TYPE}"
# cut -s to avoid retrieve the database type instead an empty version when there is no ':' on the string
export DEPLOYMENT_DATABASE_VERSION=$(echo "${OPTARG}" | cut -s -f2 -d':'); echo "## DATABASE VERSION = ${DEPLOYMENT_DATABASE_VERSION}" ;;
p) export DEPLOYMENT_PORT_PREFIX=$OPTARG; echo "## PORT PREFIX = $OPTARG";;
c) export DEPLOYMENT_CHAT_ENABLED=true;;
i) export INSTANCE_ID=$OPTARG; echo "## INSTANCE ID = $OPTARG";;
l) export DEPLOYMENT_LABELS=$OPTARG; echo "## LABELS = $OPTARG";;
h) print_usage_dev; exit 1;;
*) echo "Wrong parameter !!"; print_usage_dev; exit 1;;
esac
done
${SCRIPT_DIR}/adt.sh $ACTION
exit 0