|
@@ -0,0 +1,48 @@
|
|
1
|
+#!/bin/bash
|
|
2
|
+
|
|
3
|
+schroot_cmd="schroot --directory /tmp -c lodel2"
|
|
4
|
+chrootdir="/localdata/lodel2-chroot"
|
|
5
|
+chroot_tarball="/localdata/lodel2-chroot.raz.tar.gz"
|
|
6
|
+chroot_instance_dir="/tmp/lodel2_instances/"
|
|
7
|
+
|
|
8
|
+mongodb_host="147.94.102.23"
|
|
9
|
+mongodb_login="admin"
|
|
10
|
+mongodb_pass="pass"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+echo "##############"
|
|
15
|
+echo "# Chroot RAZ #"
|
|
16
|
+echo "##############"
|
|
17
|
+mv $chrootdir ${chrootdir}_bck
|
|
18
|
+tar -xf $chroot_tarball && rm -R ${chrootdir}_bck || echo "RAZ failed, backup can be found in lodel2-chroot_bck"
|
|
19
|
+
|
|
20
|
+echo "Installing lodel2 in chroot"
|
|
21
|
+cp -v /tmp/lodel2_0.1_amd64.deb $chrootdir/tmp/
|
|
22
|
+$schroot_cmd -- /bin/bash -c 'dpkg -i /tmp/lodel2_0.1_amd64.deb ; apt install -yf'
|
|
23
|
+echo "####################"
|
|
24
|
+echo "# Lodel2 installed #"
|
|
25
|
+echo "####################"
|
|
26
|
+echo ""
|
|
27
|
+echo "#########################"
|
|
28
|
+echo "# Installing other deps #"
|
|
29
|
+echo "#########################"
|
|
30
|
+$schroot_cmd -- apt -y install mongodb-clients pwgen wamerican vim
|
|
31
|
+
|
|
32
|
+echo "##########################################"
|
|
33
|
+echo "# Configuring mass_deploy mongodb access #"
|
|
34
|
+echo "##########################################"
|
|
35
|
+$schroot_cmd -- bash -c "echo -e \"MONGODB_ADMIN_USER='$mongodb_login'\nMONGODB_ADMIN_PASSWORD='$mongodb_pass'\nMONGODB_HOST='$mongodb_host'\" >> /etc/lodel2/mass_deploy.cfg"
|
|
36
|
+$schroot_cmd -- bash -c "echo exit | mongo $mongodb_host --quiet -u $mongodb_login -p $mongodb_pass --authenticationDatabase admin && echo Connection to mongodb ok || echo connection fails"
|
|
37
|
+
|
|
38
|
+echo "####################################"
|
|
39
|
+echo "# Preparing lodel2 standalone mode #"
|
|
40
|
+echo "####################################"
|
|
41
|
+
|
|
42
|
+$schroot_cmd -- mkdir -vp $chroot_instance_dir
|
|
43
|
+$schroot_cmd -- cp -v /usr/lib/python3/dist-packages/lodel/plugins/multisite/loader.py $chroot_instance_dir
|
|
44
|
+
|
|
45
|
+echo -e "\n\nChroot RAZ and ready to run lodel2"
|
|
46
|
+#echo -e "\tYou are in chroot now\n\n"
|
|
47
|
+#$schroot_cmd
|
|
48
|
+
|