blob: 947c63712ec8619d6db8eb987ecd1c15dbb7b739 [file] [log] [blame]
garciadeblas93c61312016-09-28 15:12:48 +02001#!/bin/bash
2# Copyright 2016 Telefónica Investigación y Desarrollo S.A.U.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16function usage(){
17 echo -e "usage: $0 [OPTIONS]"
garciadeblasa1fc4572017-04-24 19:08:21 +020018 echo -e "Install OSM from binaries or source code (by default, from binaries)"
garciadeblas93c61312016-09-28 15:12:48 +020019 echo -e " OPTIONS"
garciadeblas0d934c12017-11-17 15:39:17 +010020 echo -e " --uninstall: uninstall OSM: remove the containers and delete NAT rules"
21 echo -e " --source: install OSM from source code using the latest stable tag"
Mike Marchetti425f8ce2017-06-15 13:02:16 -040022 echo -e " -r <repo>: use specified repository name for osm packages"
garciadeblas0d934c12017-11-17 15:39:17 +010023 echo -e " -R <release>: use specified release for osm binaries (deb packages, lxd images, ...)"
Mike Marchetti425f8ce2017-06-15 13:02:16 -040024 echo -e " -u <repo base>: use specified repository url for osm packages"
25 echo -e " -k <repo key>: use specified repository public key url"
garciadeblas0d934c12017-11-17 15:39:17 +010026 echo -e " -b <refspec>: install OSM from source code using a specific branch (master, v2.0, ...) or tag"
27 echo -e " -b master (main dev branch)"
28 echo -e " -b v2.0 (v2.0 branch)"
29 echo -e " -b tags/v1.1.0 (a specific tag)"
30 echo -e " ..."
31 echo -e " --lxdimages: download lxd images from OSM repository instead of creating them from scratch"
32 echo -e " -l <lxd_repo>: use specified repository url for lxd images"
peustermd74dc842018-01-24 15:32:17 +010033 echo -e " --vimemu: additionally fetch, build, and deploy the VIM emulator as a docker container"
garciadeblas0d934c12017-11-17 15:39:17 +010034 echo -e " --develop: (deprecated, use '-b master') install OSM from source code using the master branch"
35# echo -e " --reconfigure: reconfigure the modules (DO NOT change NAT rules)"
36 echo -e " --nat: install only NAT rules"
37 echo -e " --noconfigure: DO NOT install osmclient, DO NOT install NAT rules, DO NOT configure modules"
38# echo -e " --update: update to the latest stable release or to the latest commit if using a specific branch"
39 echo -e " --showopts: print chosen options and exit (only for debugging)"
40 echo -e " -y: do not prompt for confirmation, assumes yes"
41 echo -e " -h / --help: print this help"
garciadeblas93c61312016-09-28 15:12:48 +020042}
43
garciadeblas55490d42016-10-29 14:22:03 +020044#Uninstall OSM: remove containers
45function uninstall(){
garciadeblasa1fc4572017-04-24 19:08:21 +020046 echo -e "\nUninstalling OSM"
garciadeblas55490d42016-10-29 14:22:03 +020047 if [ $RC_CLONE ] || [ -n "$TEST_INSTALLER" ]; then
48 $OSM_DEVOPS/jenkins/host/clean_container RO
49 $OSM_DEVOPS/jenkins/host/clean_container VCA
50 $OSM_DEVOPS/jenkins/host/clean_container SO
51 #$OSM_DEVOPS/jenkins/host/clean_container UI
52 else
53 lxc stop RO && lxc delete RO
54 lxc stop VCA && lxc delete VCA
55 lxc stop SO-ub && lxc delete SO-ub
56 fi
57}
58
59#Configure NAT rules, based on the current IP addresses of containers
60function nat(){
61 echo -e "\nChecking required packages: iptables-persistent"
62 dpkg -l iptables-persistent &>/dev/null || ! echo -e " Not installed.\nInstalling iptables-persistent requires root privileges" || \
63 sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install iptables-persistent
64 echo -e "\nConfiguring NAT rules"
65 echo -e " Required root privileges"
66 sudo $OSM_DEVOPS/installers/nat_osm
67}
68
Mike Marchettid8577f52017-10-19 15:27:48 -040069function FATAL(){
70 echo "FATAL error: Cannot install OSM due to \"$1\""
71 exit 1
72}
73
garciadeblas2a382732017-01-12 12:11:14 +010074#Update RO, SO and UI:
75function update(){
76 echo -e "\nUpdating components"
77
78 echo -e " Updating RO"
79 CONTAINER="RO"
80 MDG="RO"
81 INSTALL_FOLDER="/opt/openmano"
82 echo -e " Fetching the repo"
83 lxc exec $CONTAINER -- git -C $INSTALL_FOLDER fetch --all
84 BRANCH=""
85 BRANCH=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER status -sb | head -n1 | sed -n 's/^## \(.*\).*/\1/p'|awk '{print $1}' |sed 's/\(.*\)\.\.\..*/\1/'`
Jokin Garayc17db012017-03-08 17:45:39 +010086 [ -z "$BRANCH" ] && FATAL "Could not find the current branch in use in the '$MDG'"
garciadeblas2a382732017-01-12 12:11:14 +010087 CURRENT=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER status |head -n1`
88 CURRENT_COMMIT_ID=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER rev-parse HEAD`
89 echo " FROM: $CURRENT ($CURRENT_COMMIT_ID)"
90 # COMMIT_ID either was previously set with -b option, or is an empty string
91 CHECKOUT_ID=$COMMIT_ID
92 [ -z "$CHECKOUT_ID" ] && [ "$BRANCH" == "HEAD" ] && CHECKOUT_ID="tags/$LATEST_STABLE_DEVOPS"
93 [ -z "$CHECKOUT_ID" ] && [ "$BRANCH" != "HEAD" ] && CHECKOUT_ID="$BRANCH"
94 if [[ $CHECKOUT_ID == "tags/"* ]]; then
95 REMOTE_COMMIT_ID=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER rev-list -n 1 $CHECKOUT_ID`
96 else
97 REMOTE_COMMIT_ID=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER rev-parse origin/$CHECKOUT_ID`
98 fi
99 echo " TO: $CHECKOUT_ID ($REMOTE_COMMIT_ID)"
100 if [ "$CURRENT_COMMIT_ID" == "$REMOTE_COMMIT_ID" ]; then
101 echo " Nothing to be done."
102 else
103 echo " Update required."
garciadeblasa1fc4572017-04-24 19:08:21 +0200104 lxc exec $CONTAINER -- service osm-ro stop
garciadeblas2a382732017-01-12 12:11:14 +0100105 lxc exec $CONTAINER -- git -C /opt/openmano stash
106 lxc exec $CONTAINER -- git -C /opt/openmano pull --rebase
107 lxc exec $CONTAINER -- git -C /opt/openmano checkout $CHECKOUT_ID
108 lxc exec $CONTAINER -- git -C /opt/openmano stash pop
109 lxc exec $CONTAINER -- /opt/openmano/database_utils/migrate_mano_db.sh
garciadeblasa1fc4572017-04-24 19:08:21 +0200110 lxc exec $CONTAINER -- service osm-ro start
garciadeblas2a382732017-01-12 12:11:14 +0100111 fi
112 echo
113
114 echo -e " Updating SO and UI"
115 CONTAINER="SO-ub"
116 MDG="SO"
117 INSTALL_FOLDER="" # To be filled in
118 echo -e " Fetching the repo"
119 lxc exec $CONTAINER -- git -C $INSTALL_FOLDER fetch --all
120 BRANCH=""
121 BRANCH=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER status -sb | head -n1 | sed -n 's/^## \(.*\).*/\1/p'|awk '{print $1}' |sed 's/\(.*\)\.\.\..*/\1/'`
Jokin Garayc17db012017-03-08 17:45:39 +0100122 [ -z "$BRANCH" ] && FATAL "Could not find the current branch in use in the '$MDG'"
garciadeblas2a382732017-01-12 12:11:14 +0100123 CURRENT=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER status |head -n1`
124 CURRENT_COMMIT_ID=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER rev-parse HEAD`
125 echo " FROM: $CURRENT ($CURRENT_COMMIT_ID)"
126 # COMMIT_ID either was previously set with -b option, or is an empty string
127 CHECKOUT_ID=$COMMIT_ID
128 [ -z "$CHECKOUT_ID" ] && [ "$BRANCH" == "HEAD" ] && CHECKOUT_ID="tags/$LATEST_STABLE_DEVOPS"
129 [ -z "$CHECKOUT_ID" ] && [ "$BRANCH" != "HEAD" ] && CHECKOUT_ID="$BRANCH"
130 if [[ $CHECKOUT_ID == "tags/"* ]]; then
131 REMOTE_COMMIT_ID=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER rev-list -n 1 $CHECKOUT_ID`
132 else
133 REMOTE_COMMIT_ID=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER rev-parse origin/$CHECKOUT_ID`
134 fi
135 echo " TO: $CHECKOUT_ID ($REMOTE_COMMIT_ID)"
136 if [ "$CURRENT_COMMIT_ID" == "$REMOTE_COMMIT_ID" ]; then
137 echo " Nothing to be done."
138 else
139 echo " Update required."
140 # Instructions to be added
141 # lxc exec SO-ub -- ...
142 fi
143 echo
144}
145
Mike Marchetti2b951282017-10-10 15:43:15 -0400146function so_is_up() {
garciadeblas0d934c12017-11-17 15:39:17 +0100147 if [ -n "$1" ]; then
148 SO_IP=$1
149 else
150 SO_IP=`lxc list SO-ub -c 4|grep eth0 |awk '{print $2}'`
151 fi
Mike Marchetti6930bc02017-05-31 16:33:02 -0400152 time=0
153 step=5
154 timelength=300
155 while [ $time -le $timelength ]
156 do
Mike Marchetti2b951282017-10-10 15:43:15 -0400157 if [[ `curl -k -X GET https://$SO_IP:8008/api/operational/vcs/info \
158 -H 'accept: application/vnd.yang.data+json' \
159 -H 'authorization: Basic YWRtaW46YWRtaW4=' \
160 -H 'cache-control: no-cache' 2> /dev/null | jq '.[].components.component_info[] | select(.component_name=="RW.Restconf")' 2>/dev/null | grep "RUNNING" | wc -l` -eq 1 ]]
161 then
162 echo "RW.Restconf running....SO is up"
163 return 0
Mike Marchetti6930bc02017-05-31 16:33:02 -0400164 fi
Mike Marchetti2b951282017-10-10 15:43:15 -0400165
Mike Marchetti6930bc02017-05-31 16:33:02 -0400166 sleep $step
167 echo -n "."
168 time=$((time+step))
169 done
Mike Marchetti2b951282017-10-10 15:43:15 -0400170
garciadeblas0d934c12017-11-17 15:39:17 +0100171 FATAL "OSM Failed to startup. SO failed to startup"
Mike Marchetti6930bc02017-05-31 16:33:02 -0400172}
173
garciadeblas0d934c12017-11-17 15:39:17 +0100174function vca_is_up() {
175 if [[ `lxc exec VCA -- juju status | grep "osm" | wc -l` -eq 1 ]]; then
176 echo "VCA is up and running"
177 return 0
178 fi
garciadeblas55490d42016-10-29 14:22:03 +0200179
garciadeblas0d934c12017-11-17 15:39:17 +0100180 FATAL "OSM Failed to startup. VCA failed to startup"
181}
182
183function ro_is_up() {
184 if [ -n "$1" ]; then
185 RO_IP=$1
186 else
187 RO_IP=`lxc list RO -c 4|grep eth0 |awk '{print $2}'`
188 fi
189 time=0
190 step=2
191 timelength=20
192 while [ $time -le $timelength ]; do
193 if [[ `curl http://$RO_IP:9090/openmano/ | grep "works" | wc -l` -eq 1 ]]; then
194 echo "RO is up and running"
195 return 0
196 fi
197 sleep $step
198 echo -n "."
199 time=$((time+step))
200 done
201
202 FATAL "OSM Failed to startup. RO failed to startup"
203}
204
205
206function configure_RO(){
207 . $OSM_DEVOPS/installers/export_ips
garciadeblas55490d42016-10-29 14:22:03 +0200208 echo -e " Configuring RO"
garciadeblasa1fc4572017-04-24 19:08:21 +0200209 lxc exec RO -- sed -i -e "s/^\#\?log_socket_host:.*/log_socket_host: $SO_CONTAINER_IP/g" /etc/osm/openmanod.cfg
210 lxc exec RO -- service osm-ro restart
Mike Marchetti6930bc02017-05-31 16:33:02 -0400211
garciadeblas0d934c12017-11-17 15:39:17 +0100212 ro_is_up
Mike Marchetti6930bc02017-05-31 16:33:02 -0400213
garciadeblasd8718f12016-10-30 19:39:01 +0100214 lxc exec RO -- openmano tenant-delete -f osm >/dev/null
garciadeblas1b7107e2017-12-21 15:32:02 +0100215 lxc exec RO -- openmano tenant-create osm > /dev/null
tierno15f4f222017-06-14 13:23:01 +0200216 lxc exec RO -- sed -i '/export OPENMANO_TENANT=osm/d' .bashrc
217 lxc exec RO -- sed -i '$ i export OPENMANO_TENANT=osm' .bashrc
garciadeblas1b7107e2017-12-21 15:32:02 +0100218 lxc exec RO -- sh -c 'echo "export OPENMANO_TENANT=osm" >> .bashrc'
garciadeblas0d934c12017-11-17 15:39:17 +0100219}
garciadeblas55490d42016-10-29 14:22:03 +0200220
garciadeblas0d934c12017-11-17 15:39:17 +0100221function configure_VCA(){
garciadeblas55490d42016-10-29 14:22:03 +0200222 echo -e " Configuring VCA"
223 JUJU_PASSWD=`date +%s | sha256sum | base64 | head -c 32`
224 echo -e "$JUJU_PASSWD\n$JUJU_PASSWD" | lxc exec VCA -- juju change-user-password
garciadeblas0d934c12017-11-17 15:39:17 +0100225}
226
227function configure_SOUI(){
228 . $OSM_DEVOPS/installers/export_ips
garciadeblas55490d42016-10-29 14:22:03 +0200229 JUJU_CONTROLLER_IP=`lxc exec VCA -- lxc list -c 4 |grep eth0 |awk '{print $2}'`
garciadeblas1b7107e2017-12-21 15:32:02 +0100230 RO_TENANT_ID=`lxc exec RO -- openmano tenant-list osm |awk '{print $1}'`
garciadeblas55490d42016-10-29 14:22:03 +0200231
232 echo -e " Configuring SO"
233 sudo route add -host $JUJU_CONTROLLER_IP gw $VCA_CONTAINER_IP
garciadeblas2f4c93b2017-04-10 18:12:12 +0200234 sudo sed -i "$ i route add -host $JUJU_CONTROLLER_IP gw $VCA_CONTAINER_IP" /etc/rc.local
Jeremy Mordkoff5cc6ccc2017-10-05 15:21:07 -0400235 # make journaling persistent
236 lxc exec SO-ub -- mkdir -p /var/log/journal
237 lxc exec SO-ub -- systemd-tmpfiles --create --prefix /var/log/journal
238 lxc exec SO-ub -- systemctl restart systemd-journald
239
Jeremy Mordkoff3b3edea2017-10-03 16:21:56 -0400240 echo RIFT_EXTERNAL_ADDRESS=$DEFAULT_IP | lxc exec SO-ub -- tee -a /usr/rift/etc/default/launchpad
241
Mike Marchetti6930bc02017-05-31 16:33:02 -0400242 lxc exec SO-ub -- systemctl restart launchpad
garciadeblas55490d42016-10-29 14:22:03 +0200243
Mike Marchetti6930bc02017-05-31 16:33:02 -0400244 so_is_up $SO_CONTAINER_IP
245
246 #delete existing config agent (could be there on reconfigure)
247 curl -k --request DELETE \
248 --url https://$SO_CONTAINER_IP:8008/api/config/config-agent/account/osmjuju \
249 --header 'accept: application/vnd.yang.data+json' \
250 --header 'authorization: Basic YWRtaW46YWRtaW4=' \
251 --header 'cache-control: no-cache' \
252 --header 'content-type: application/vnd.yang.data+json' &> /dev/null
253
254 result=$(curl -k --request POST \
garciadeblas55490d42016-10-29 14:22:03 +0200255 --url https://$SO_CONTAINER_IP:8008/api/config/config-agent \
256 --header 'accept: application/vnd.yang.data+json' \
257 --header 'authorization: Basic YWRtaW46YWRtaW4=' \
258 --header 'cache-control: no-cache' \
259 --header 'content-type: application/vnd.yang.data+json' \
Mike Marchetti6930bc02017-05-31 16:33:02 -0400260 --data '{"account": [ { "name": "osmjuju", "account-type": "juju", "juju": { "ip-address": "'$JUJU_CONTROLLER_IP'", "port": "17070", "user": "admin", "secret": "'$JUJU_PASSWD'" } } ]}')
261 [[ $result =~ .*success.* ]] || FATAL "Failed config-agent configuration: $result"
garciadeblas55490d42016-10-29 14:22:03 +0200262
Mike Marchetti397a65d2017-10-02 22:36:16 -0400263 #R1/R2 config line
264 #result=$(curl -k --request PUT \
265 # --url https://$SO_CONTAINER_IP:8008/api/config/resource-orchestrator \
266 # --header 'accept: application/vnd.yang.data+json' \
267 # --header 'authorization: Basic YWRtaW46YWRtaW4=' \
268 # --header 'cache-control: no-cache' \
269 # --header 'content-type: application/vnd.yang.data+json' \
270 # --data '{ "openmano": { "host": "'$RO_CONTAINER_IP'", "port": "9090", "tenant-id": "'$RO_TENANT_ID'" }, "name": "osmopenmano", "account-type": "openmano" }')
271
Mike Marchetti6930bc02017-05-31 16:33:02 -0400272 result=$(curl -k --request PUT \
Mike Marchetti397a65d2017-10-02 22:36:16 -0400273 --url https://$SO_CONTAINER_IP:8008/api/config/project/default/ro-account/account \
garciadeblas55490d42016-10-29 14:22:03 +0200274 --header 'accept: application/vnd.yang.data+json' \
275 --header 'authorization: Basic YWRtaW46YWRtaW4=' \
Mike Marchetti397a65d2017-10-02 22:36:16 -0400276 --header 'cache-control: no-cache' \
garciadeblas55490d42016-10-29 14:22:03 +0200277 --header 'content-type: application/vnd.yang.data+json' \
Mike Marchetti397a65d2017-10-02 22:36:16 -0400278 --data '{"rw-ro-account:account": [ { "openmano": { "host": "'$RO_CONTAINER_IP'", "port": "9090", "tenant-id": "'$RO_TENANT_ID'"}, "name": "osmopenmano", "ro-account-type": "openmano" }]}')
Mike Marchetti6930bc02017-05-31 16:33:02 -0400279 [[ $result =~ .*success.* ]] || FATAL "Failed resource-orchestrator configuration: $result"
Jeremy Mordkoff2059b392017-10-03 17:34:10 -0400280
Jeremy Mordkoff34151f22017-10-04 19:45:37 -0400281 result=$(curl -k --request PATCH \
282 --url https://$SO_CONTAINER_IP:8008/v2/api/config/openidc-provider-config/rw-ui-client/redirect-uri \
283 --header 'accept: application/vnd.yang.data+json' \
284 --header 'authorization: Basic YWRtaW46YWRtaW4=' \
285 --header 'cache-control: no-cache' \
286 --header 'content-type: application/vnd.yang.data+json' \
287 --data '{"redirect-uri": "https://'$DEFAULT_IP':8443/callback" }')
288 [[ $result =~ .*success.* ]] || FATAL "Failed redirect-uri configuration: $result"
289
290 result=$(curl -k --request PATCH \
291 --url https://$SO_CONTAINER_IP:8008/v2/api/config/openidc-provider-config/rw-ui-client/post-logout-redirect-uri \
292 --header 'accept: application/vnd.yang.data+json' \
293 --header 'authorization: Basic YWRtaW46YWRtaW4=' \
294 --header 'cache-control: no-cache' \
295 --header 'content-type: application/vnd.yang.data+json' \
296 --data '{"post-logout-redirect-uri": "https://'$DEFAULT_IP':8443/?api_server=https://'$DEFAULT_IP'" }')
297 [[ $result =~ .*success.* ]] || FATAL "Failed post-logout-redirect-uri configuration: $result"
298
Jeremy Mordkofff4b6e622017-10-04 12:05:41 -0400299 lxc exec SO-ub -- tee /etc/network/interfaces.d/60-rift.cfg <<EOF
300auto lo:1
301iface lo:1 inet static
302 address $DEFAULT_IP
303 netmask 255.255.255.255
304EOF
305 lxc exec SO-ub ifup lo:1
garciadeblas0d934c12017-11-17 15:39:17 +0100306}
Jeremy Mordkoff2059b392017-10-03 17:34:10 -0400307
garciadeblas0d934c12017-11-17 15:39:17 +0100308#Configure RO, VCA, and SO with the initial configuration:
309# RO -> tenant:osm, logs to be sent to SO
310# VCA -> juju-password
311# SO -> route to Juju Controller, add RO account, add VCA account
312function configure(){
313 #Configure components
314 echo -e "\nConfiguring components"
315 configure_RO
316 configure_VCA
317 configure_SOUI
garciadeblas55490d42016-10-29 14:22:03 +0200318}
319
garciadeblas2a5a6512016-12-19 10:19:52 +0100320function install_lxd() {
garciadeblas0d934c12017-11-17 15:39:17 +0100321 sudo apt-get update
322 sudo apt-get install -y lxd
323 newgrp lxd
garciadeblas2a5a6512016-12-19 10:19:52 +0100324 lxd init --auto
325 lxd waitready
garciadeblas0d934c12017-11-17 15:39:17 +0100326 lxc network create lxdbr0 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false
327 DEFAULT_INTERFACE=$(route -n | awk '$1~/^0.0.0.0/ {print $8}')
328 DEFAULT_MTU=$( ip addr show $DEFAULT_INTERFACE | perl -ne 'if (/mtu\s(\d+)/) {print $1;}')
329 lxc profile device set default eth0 mtu $DEFAULT_MTU
330 #sudo systemctl stop lxd-bridge
331 #sudo systemctl --system daemon-reload
332 #sudo systemctl enable lxd-bridge
333 #sudo systemctl start lxd-bridge
garciadeblas2a5a6512016-12-19 10:19:52 +0100334}
335
tierno53881d72017-04-25 11:58:57 +0200336function ask_user(){
337 # ask to the user and parse a response among 'y', 'yes', 'n' or 'no'. Case insensitive
338 # Params: $1 text to ask; $2 Action by default, can be 'y' for yes, 'n' for no, other or empty for not allowed
339 # Return: true(0) if user type 'yes'; false (1) if user type 'no'
340 read -e -p "$1" USER_CONFIRMATION
341 while true ; do
342 [ -z "$USER_CONFIRMATION" ] && [ "$2" == 'y' ] && return 0
343 [ -z "$USER_CONFIRMATION" ] && [ "$2" == 'n' ] && return 1
344 [ "${USER_CONFIRMATION,,}" == "yes" ] || [ "${USER_CONFIRMATION,,}" == "y" ] && return 0
345 [ "${USER_CONFIRMATION,,}" == "no" ] || [ "${USER_CONFIRMATION,,}" == "n" ] && return 1
346 read -e -p "Please type 'yes' or 'no': " USER_CONFIRMATION
347 done
348}
garciadeblas2a5a6512016-12-19 10:19:52 +0100349
garciadeblas0d934c12017-11-17 15:39:17 +0100350function launch_container_from_lxd(){
351 export OSM_MDG=$1
352 OSM_load_config
353 export OSM_BASE_IMAGE=$2
354 if ! container_exists $OSM_BUILD_CONTAINER; then
355 CONTAINER_OPTS=""
356 [[ "$OSM_BUILD_CONTAINER_PRIVILEGED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.privileged=true"
357 [[ "$OSM_BUILD_CONTAINER_ALLOW_NESTED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.nesting=true"
358 create_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER $CONTAINER_OPTS
359 wait_container_up $OSM_BUILD_CONTAINER
360 fi
361}
362
363function install_osmclient(){
364 CLIENT_RELEASE=${RELEASE#"-R "}
365 CLIENT_REPOSITORY_KEY="OSM%20ETSI%20Release%20Key.gpg"
366 CLIENT_REPOSITORY="stable"
367 [ -z "$REPOSITORY_BASE" ] && REPOSITORY_BASE="-u https://osm-download.etsi.org/repository/osm/debian"
368 CLIENT_REPOSITORY_BASE=${REPOSITORY_BASE#"-u "}
369 key_location=$CLIENT_REPOSITORY_BASE/$CLIENT_RELEASE/$CLIENT_REPOSITORY_KEY
370 curl $key_location | sudo apt-key add -
371 sudo add-apt-repository -y "deb [arch=amd64] $CLIENT_REPOSITORY_BASE/$CLIENT_RELEASE $CLIENT_REPOSITORY osmclient"
372 sudo apt-get update
373 sudo apt-get install -y python-osmclient
374 export OSM_HOSTNAME=`lxc list | awk '($2=="SO-ub"){print $6}'`
375 export OSM_RO_HOSTNAME=`lxc list | awk '($2=="RO"){print $6}'`
376 echo -e "\nOSM client installed"
377 echo -e "You might be interested in adding the following OSM client env variables to your .bashrc file:"
378 echo " export OSM_HOSTNAME=${OSM_HOSTNAME}"
379 echo " export OSM_RO_HOSTNAME=${OSM_RO_HOSTNAME}"
380}
381
382function install_from_lxdimages(){
383 LXD_RELEASE=${RELEASE#"-R "}
384 LXD_IMAGE_DIR="$(mktemp -d -q --tmpdir "osmimages.XXXXXX")"
385 trap 'rm -rf "$LXD_IMAGE_DIR"' EXIT
386 wget -O $LXD_IMAGE_DIR/osm-ro.tar.gz $LXD_REPOSITORY_BASE/$LXD_RELEASE/osm-ro.tar.gz
387 lxc image import $LXD_IMAGE_DIR/osm-ro.tar.gz --alias osm-ro
388 rm -f $LXD_IMAGE_DIR/osm-ro.tar.gz
389 wget -O $LXD_IMAGE_DIR/osm-vca.tar.gz $LXD_REPOSITORY_BASE/$LXD_RELEASE/osm-vca.tar.gz
390 lxc image import $LXD_IMAGE_DIR/osm-vca.tar.gz --alias osm-vca
391 rm -f $LXD_IMAGE_DIR/osm-vca.tar.gz
392 wget -O $LXD_IMAGE_DIR/osm-soui.tar.gz $LXD_REPOSITORY_BASE/$LXD_RELEASE/osm-soui.tar.gz
393 lxc image import $LXD_IMAGE_DIR/osm-soui.tar.gz --alias osm-soui
394 rm -f $LXD_IMAGE_DIR/osm-soui.tar.gz
395 launch_container_from_lxd RO osm-ro
396 ro_is_up && track RO
397 launch_container_from_lxd VCA osm-vca
398 vca_is_up && track VCA
399 launch_container_from_lxd SO osm-soui
400 #so_is_up && track SOUI
401 track SOUI
402}
403
peusterm3a3e7a52017-12-22 13:10:54 +0100404function install_docker_ce() {
405 # installs and configures Docker CE
406 echo "Installing Docker CE ..."
peusterme2c017e2018-02-07 11:51:11 +0100407 sudo apt-get -qq update
408 sudo apt-get install -y apt-transport-https ca-certificates software-properties-common
peusterm3a3e7a52017-12-22 13:10:54 +0100409 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
410 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
411 sudo apt-get -qq update
peusterme2c017e2018-02-07 11:51:11 +0100412 sudo apt-get install -y docker-ce
peusterm3a3e7a52017-12-22 13:10:54 +0100413 echo "Adding user to group 'docker'"
peusterme2c017e2018-02-07 11:51:11 +0100414 sudo groupadd -f docker
peusterm3a3e7a52017-12-22 13:10:54 +0100415 sudo usermod -aG docker $USER
416 echo "... Docker CE installation done"
peusterme2c017e2018-02-07 11:51:11 +0100417 sleep 2
418 sudo service docker restart
419 echo "... restarted Docker service"
peusterm3a3e7a52017-12-22 13:10:54 +0100420}
421
422function install_vimemu() {
423 # install Docker
424 install_docker_ce
425 # clone vim-emu repository (attention: branch is currently master only)
426 echo "Cloning vim-emu repository ..."
427 git clone https://osm.etsi.org/gerrit/osm/vim-emu.git
428 # build vim-emu docker
429 echo "Building vim-emu Docker container..."
peusterme2c017e2018-02-07 11:51:11 +0100430 sudo docker build -t vim-emu-img -f vim-emu/Dockerfile vim-emu/
peusterm3a3e7a52017-12-22 13:10:54 +0100431 # start vim-emu container as daemon
432 echo "Starting vim-emu Docker container 'vim-emu' ..."
peusterme2c017e2018-02-07 11:51:11 +0100433 sudo docker run --name vim-emu -t -d --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-img python examples/osm_default_daemon_topology_2_pop.py
peusterm3a3e7a52017-12-22 13:10:54 +0100434 echo "Waiting for 'vim-emu' container to start ..."
435 sleep 5
peusterme2c017e2018-02-07 11:51:11 +0100436 export VIMEMU_HOSTNAME=$(sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vim-emu)
peusterm3a3e7a52017-12-22 13:10:54 +0100437 echo "vim-emu running at $VIMEMU_HOSTNAME ..."
peustermd74dc842018-01-24 15:32:17 +0100438 echo -e "You might be interested in adding the following OSM client env variables to your .bashrc file:"
439 echo " export OSM_HOSTNAME=${OSM_HOSTNAME}"
440 echo " export OSM_RO_HOSTNAME=${OSM_RO_HOSTNAME}"
441 echo -e "You might be interested in adding the following vim-emu env variables to your .bashrc file:"
peusterm3a3e7a52017-12-22 13:10:54 +0100442 echo " export VIMEMU_HOSTNAME=${VIMEMU_HOSTNAME}"
443 echo -e "\nTo add the emulated VIM to OSM you should do:"
peustermd74dc842018-01-24 15:32:17 +0100444 echo " osm vim-create --name emu-vim1 --user username --password password --auth_url http://$VIMEMU_HOSTNAME:6001/v2.0 --tenant tenantName --account_type openstack"
peusterm3a3e7a52017-12-22 13:10:54 +0100445}
446
garciadeblas0d934c12017-11-17 15:39:17 +0100447function dump_vars(){
448 echo "DEVELOP=$DEVELOP"
449 echo "INSTALL_FROM_SOURCE=$INSTALL_FROM_SOURCE"
450 echo "UNINSTALL=$UNINSTALL"
451 echo "NAT=$NAT"
452 echo "UPDATE=$UPDATE"
453 echo "RECONFIGURE=$RECONFIGURE"
454 echo "TEST_INSTALLER=$TEST_INSTALLER"
peusterm3a3e7a52017-12-22 13:10:54 +0100455 echo "INSTALL_VIMEMU=$INSTALL_VIMEMU"
garciadeblas0d934c12017-11-17 15:39:17 +0100456 echo "INSTALL_LXD=$INSTALL_LXD"
457 echo "INSTALL_FROM_LXDIMAGES=$INSTALL_FROM_LXDIMAGES"
458 echo "LXD_REPOSITORY_BASE=$LXD_REPOSITORY_BASE"
459 echo "RELEASE=$RELEASE"
460 echo "REPOSITORY=$REPOSITORY"
461 echo "REPOSITORY_BASE=$REPOSITORY_BASE"
462 echo "REPOSITORY_KEY=$REPOSITORY_KEY"
463 echo "NOCONFIGURE=$NOCONFIGURE"
464 echo "SHOWOPTS=$SHOWOPTS"
465 echo "Install from specific refspec (-b): $COMMIT_ID"
466}
467
468function track(){
469 ctime=`date +%s`
470 duration=$((ctime - SESSION_ID))
471 url="http://www.woopra.com/track/ce?project=osm.etsi.org&cookie=${SESSION_ID}"
472 #url="${url}&ce_campaign_name=${CAMPAIGN_NAME}"
473 event_name="bin"
474 [ -n "$INSTALL_FROM_SOURCE" ] && event_name="src"
475 [ -n "$INSTALL_FROM_LXDIMAGES" ] && event_name="lxd"
476 event_name="${event_name}_$1"
477 url="${url}&event=${event_name}&ce_duration=${duration}"
478 wget -q -O /dev/null $url
479}
480
garciadeblas93c61312016-09-28 15:12:48 +0200481UNINSTALL=""
482DEVELOP=""
483NAT=""
garciadeblas2a382732017-01-12 12:11:14 +0100484UPDATE=""
garciadeblas55490d42016-10-29 14:22:03 +0200485RECONFIGURE=""
486TEST_INSTALLER=""
garciadeblas0d934c12017-11-17 15:39:17 +0100487INSTALL_LXD=""
garciadeblas2a5a6512016-12-19 10:19:52 +0100488SHOWOPTS=""
489COMMIT_ID=""
tierno2cc8e252017-03-08 17:12:05 +0100490ASSUME_YES=""
garciadeblasa1fc4572017-04-24 19:08:21 +0200491INSTALL_FROM_SOURCE=""
garciadeblas82442292017-11-16 14:48:12 +0100492RELEASE="-R ReleaseTHREE"
peusterm3a3e7a52017-12-22 13:10:54 +0100493INSTALL_VIMEMU=""
garciadeblas0d934c12017-11-17 15:39:17 +0100494INSTALL_FROM_LXDIMAGES=""
495LXD_REPOSITORY_BASE="https://osm-download.etsi.org/repository/osm/lxd"
496NOCONFIGURE=""
Mike Marchettica56c642017-12-16 16:04:52 -0500497RELEASE_DAILY=""
garciadeblas0d934c12017-11-17 15:39:17 +0100498SESSION_ID=`date +%s`
499
500while getopts ":hy-:b:r:k:u:R:l:" o; do
garciadeblas93c61312016-09-28 15:12:48 +0200501 case "${o}" in
502 h)
503 usage && exit 0
504 ;;
garciadeblas2a5a6512016-12-19 10:19:52 +0100505 b)
506 COMMIT_ID=${OPTARG}
507 ;;
Mike Marchetti425f8ce2017-06-15 13:02:16 -0400508 r)
509 REPOSITORY="-r ${OPTARG}"
510 ;;
511 R)
512 RELEASE="-R ${OPTARG}"
513 ;;
514 k)
515 REPOSITORY_KEY="-k ${OPTARG}"
516 ;;
517 u)
518 REPOSITORY_BASE="-u ${OPTARG}"
519 ;;
garciadeblas0d934c12017-11-17 15:39:17 +0100520 l)
521 LXD_REPOSITORY_BASE="${OPTARG}"
522 ;;
garciadeblas93c61312016-09-28 15:12:48 +0200523 -)
524 [ "${OPTARG}" == "help" ] && usage && exit 0
garciadeblasa1fc4572017-04-24 19:08:21 +0200525 [ "${OPTARG}" == "source" ] && INSTALL_FROM_SOURCE="y" && continue
garciadeblas93c61312016-09-28 15:12:48 +0200526 [ "${OPTARG}" == "develop" ] && DEVELOP="y" && continue
527 [ "${OPTARG}" == "uninstall" ] && UNINSTALL="y" && continue
528 [ "${OPTARG}" == "nat" ] && NAT="y" && continue
garciadeblas2a382732017-01-12 12:11:14 +0100529 [ "${OPTARG}" == "update" ] && UPDATE="y" && continue
garciadeblas55490d42016-10-29 14:22:03 +0200530 [ "${OPTARG}" == "reconfigure" ] && RECONFIGURE="y" && continue
531 [ "${OPTARG}" == "test" ] && TEST_INSTALLER="y" && continue
garciadeblas0d934c12017-11-17 15:39:17 +0100532 [ "${OPTARG}" == "lxdinstall" ] && INSTALL_LXD="y" && continue
533 [ "${OPTARG}" == "lxdimages" ] && INSTALL_FROM_LXDIMAGES="y" && continue
peusterm3a3e7a52017-12-22 13:10:54 +0100534 [ "${OPTARG}" == "vimemu" ] && INSTALL_VIMEMU="y" && continue
garciadeblas0d934c12017-11-17 15:39:17 +0100535 [ "${OPTARG}" == "noconfigure" ] && NOCONFIGURE="y" && continue
garciadeblas2a5a6512016-12-19 10:19:52 +0100536 [ "${OPTARG}" == "showopts" ] && SHOWOPTS="y" && continue
Mike Marchettica56c642017-12-16 16:04:52 -0500537 [ "${OPTARG}" == "daily" ] && RELEASE_DAILY="y" && continue
garciadeblas93c61312016-09-28 15:12:48 +0200538 echo -e "Invalid option: '--$OPTARG'\n" >&2
539 usage && exit 1
540 ;;
541 \?)
542 echo -e "Invalid option: '-$OPTARG'\n" >&2
543 usage && exit 1
544 ;;
tierno2cc8e252017-03-08 17:12:05 +0100545 y)
546 ASSUME_YES="y"
547 ;;
garciadeblas93c61312016-09-28 15:12:48 +0200548 *)
549 usage && exit 1
550 ;;
551 esac
552done
553
garciadeblasa6ff9862017-04-07 02:00:29 +0200554if [ -n "$SHOWOPTS" ]; then
garciadeblas0d934c12017-11-17 15:39:17 +0100555 dump_vars
garciadeblasa6ff9862017-04-07 02:00:29 +0200556 exit 0
557fi
558
Mike Marchettica56c642017-12-16 16:04:52 -0500559[ -n "$RELEASE_DAILY" ] && echo -e "\nInstalling from daily build repo" && RELEASE="-R ReleaseTHREE-daily" && REPOSITORY="-r testing" && COMMIT_ID="master"
560
Mike Marchetti6930bc02017-05-31 16:33:02 -0400561# if develop, we force master
garciadeblas2a5a6512016-12-19 10:19:52 +0100562[ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master"
Mike Marchetti6930bc02017-05-31 16:33:02 -0400563
Mike Marchetti0d567602017-09-29 14:30:28 -0400564# forcing source from master removed. Now only install from source when explicit
565# [ -n "$COMMIT_ID" ] && [ "$COMMIT_ID" == "master" ] && INSTALL_FROM_SOURCE="y"
garciadeblas2a5a6512016-12-19 10:19:52 +0100566
garciadeblas55490d42016-10-29 14:22:03 +0200567if [ -n "$TEST_INSTALLER" ]; then
568 echo -e "\nUsing local devops repo for OSM installation"
569 TEMPDIR="$(dirname $(realpath $(dirname $0)))"
570else
571 echo -e "\nCreating temporary dir for OSM installation"
572 TEMPDIR="$(mktemp -d -q --tmpdir "installosm.XXXXXX")"
573 trap 'rm -rf "$TEMPDIR"' EXIT
574fi
garciadeblas93c61312016-09-28 15:12:48 +0200575
Mike Marchetti2b951282017-10-10 15:43:15 -0400576need_packages="git jq"
577for package in $need_packages; do
578 echo -e "Checking required packages: $package"
Mike Marchettid8577f52017-10-19 15:27:48 -0400579 dpkg -l $package &>/dev/null \
580 || ! echo -e " $package not installed.\nInstalling $package requires root privileges" \
581 || sudo apt-get install -y $package \
582 || FATAL "failed to install $package"
Mike Marchetti2b951282017-10-10 15:43:15 -0400583done
584
garciadeblas55490d42016-10-29 14:22:03 +0200585if [ -z "$TEST_INSTALLER" ]; then
586 echo -e "\nCloning devops repo temporarily"
587 git clone https://osm.etsi.org/gerrit/osm/devops.git $TEMPDIR
588 RC_CLONE=$?
garciadeblas55490d42016-10-29 14:22:03 +0200589fi
garciadeblas2a382732017-01-12 12:11:14 +0100590
591echo -e "\nGuessing the current stable release"
Mike Marchetti91df8352017-10-17 13:47:48 -0400592LATEST_STABLE_DEVOPS=`git -C $TEMPDIR tag -l v[0-9].* | sort -V | tail -n1`
garciadeblas2a382732017-01-12 12:11:14 +0100593[ -z "$COMMIT_ID" ] && [ -z "$LATEST_STABLE_DEVOPS" ] && echo "Could not find the current latest stable release" && exit 0
garciadeblasa6ff9862017-04-07 02:00:29 +0200594echo "Latest tag in devops repo: $LATEST_STABLE_DEVOPS"
595[ -z "$COMMIT_ID" ] && [ -n "$LATEST_STABLE_DEVOPS" ] && COMMIT_ID="tags/$LATEST_STABLE_DEVOPS"
Mike Marchettica56c642017-12-16 16:04:52 -0500596
597if [ -n "$RELEASE_DAILY" ]; then
598 echo "Using master/HEAD devops"
599 git -C $TEMPDIR checkout master
600elif [ -z "$TEST_INSTALLER" ]; then
601 git -C $TEMPDIR checkout tags/$LATEST_STABLE_DEVOPS
602fi
garciadeblas2a382732017-01-12 12:11:14 +0100603
garciadeblas93c61312016-09-28 15:12:48 +0200604OSM_DEVOPS=$TEMPDIR
garciadeblas0fe45dd2016-10-04 07:54:17 +0200605OSM_JENKINS="$TEMPDIR/jenkins"
606. $OSM_JENKINS/common/all_funcs
garciadeblas93c61312016-09-28 15:12:48 +0200607
garciadeblasd8718f12016-10-30 19:39:01 +0100608[ -n "$UNINSTALL" ] && uninstall && echo -e "\nDONE" && exit 0
609[ -n "$NAT" ] && nat && echo -e "\nDONE" && exit 0
garciadeblas2a382732017-01-12 12:11:14 +0100610[ -n "$UPDATE" ] && update && echo -e "\nDONE" && exit 0
garciadeblasd8718f12016-10-30 19:39:01 +0100611[ -n "$RECONFIGURE" ] && configure && echo -e "\nDONE" && exit 0
garciadeblas93c61312016-09-28 15:12:48 +0200612
613#Installation starts here
garciadeblasa1fc4572017-04-24 19:08:21 +0200614echo -e "\nInstalling OSM from refspec: $COMMIT_ID"
615if [ -n "$INSTALL_FROM_SOURCE" ] && [ -z "$ASSUME_YES" ]; then
tierno53881d72017-04-25 11:58:57 +0200616 ! ask_user "The installation will take about 75-90 minutes. Continue (Y/n)? " y && echo "Cancelled!" && exit 1
tierno2cc8e252017-03-08 17:12:05 +0100617fi
618
garciadeblasa1fc4572017-04-24 19:08:21 +0200619echo -e "\nChecking required packages: wget, curl, tar"
620dpkg -l wget curl tar &>/dev/null || ! echo -e " One or several packages are not installed.\nInstalling required packages\n Root privileges are required" || sudo apt-get install -y wget curl tar
621
Jokin Garayc0a65962017-03-09 14:51:48 +0100622echo -e "Checking required packages: lxd"
garciadeblasd880f722017-04-07 20:14:57 +0200623lxd --version &>/dev/null || FATAL "lxd not present, exiting."
garciadeblas0d934c12017-11-17 15:39:17 +0100624[ -n "$INSTALL_LXD" ] && echo -e "\nInstalling and configuring lxd" && install_lxd
garciadeblas2a5a6512016-12-19 10:19:52 +0100625
Mike Marchettib884a462017-10-05 13:28:33 -0400626wget -q -O- https://osm-download.etsi.org/ftp/osm-3.0-three/README.txt &> /dev/null
garciadeblas0d934c12017-11-17 15:39:17 +0100627track start
garciadeblas93c61312016-09-28 15:12:48 +0200628
Mike Marchettid1e08b92017-09-29 16:14:11 -0400629# use local devops for containers
630export OSM_USE_LOCAL_DEVOPS=true
garciadeblas0d934c12017-11-17 15:39:17 +0100631if [ -n "$INSTALL_FROM_SOURCE" ]; then #install from source
garciadeblasa1fc4572017-04-24 19:08:21 +0200632 echo -e "\nCreating the containers and building from source ..."
633 $OSM_DEVOPS/jenkins/host/start_build RO --notest checkout $COMMIT_ID || FATAL "RO container build failed (refspec: '$COMMIT_ID')"
garciadeblas0d934c12017-11-17 15:39:17 +0100634 ro_is_up && track RO
garciadeblasa1fc4572017-04-24 19:08:21 +0200635 $OSM_DEVOPS/jenkins/host/start_build VCA || FATAL "VCA container build failed"
garciadeblas0d934c12017-11-17 15:39:17 +0100636 vca_is_up && track VCA
garciadeblasa1fc4572017-04-24 19:08:21 +0200637 $OSM_DEVOPS/jenkins/host/start_build SO checkout $COMMIT_ID || FATAL "SO container build failed (refspec: '$COMMIT_ID')"
638 $OSM_DEVOPS/jenkins/host/start_build UI checkout $COMMIT_ID || FATAL "UI container build failed (refspec: '$COMMIT_ID')"
garciadeblas0d934c12017-11-17 15:39:17 +0100639 #so_is_up && track SOUI
640 track SOUI
641elif [ -n "$INSTALL_FROM_LXDIMAGES" ]; then #install from LXD images stored in OSM repo
642 echo -e "\nInstalling from lxd images ..."
643 install_from_lxdimages
644else #install from binaries
645 echo -e "\nCreating the containers and installing from binaries ..."
646 $OSM_DEVOPS/jenkins/host/install RO $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "RO install failed"
647 ro_is_up && track RO
648 $OSM_DEVOPS/jenkins/host/start_build VCA || FATAL "VCA install failed"
649 vca_is_up && track VCA
650 $OSM_DEVOPS/jenkins/host/install SO $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "SO install failed"
651 $OSM_DEVOPS/jenkins/host/install UI $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "UI install failed"
652 #so_is_up && track SOUI
653 track SOUI
garciadeblasa1fc4572017-04-24 19:08:21 +0200654fi
garciadeblas93c61312016-09-28 15:12:48 +0200655
garciadeblas55490d42016-10-29 14:22:03 +0200656#Install iptables-persistent and configure NAT rules
garciadeblas0d934c12017-11-17 15:39:17 +0100657[ -z "$NOCONFIGURE" ] && nat
garciadeblas93c61312016-09-28 15:12:48 +0200658
659#Configure components
garciadeblas0d934c12017-11-17 15:39:17 +0100660[ -z "$NOCONFIGURE" ] && configure
661
662#Install osmclient
663[ -z "$NOCONFIGURE" ] && install_osmclient
garciadeblas93c61312016-09-28 15:12:48 +0200664
peusterm3a3e7a52017-12-22 13:10:54 +0100665#Install vim-emu (optional)
666if [ -n "$INSTALL_VIMEMU" ]; then
667 echo -e "\nInstalling vim-emu ..."
668 install_vimemu
669fi
670
Mike Marchettib884a462017-10-05 13:28:33 -0400671wget -q -O- https://osm-download.etsi.org/ftp/osm-3.0-three/README2.txt &> /dev/null
garciadeblas0d934c12017-11-17 15:39:17 +0100672track end
Jokin Garay3eb9ce72017-03-09 14:48:11 +0100673echo -e "\nDONE"
garciadeblas0d934c12017-11-17 15:39:17 +0100674