summaryrefslogtreecommitdiffstats
path: root/adei/scripts/adei-branch.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-02-20 16:16:15 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-02-20 16:16:15 +0100
commit3d19ce5671e45b8e06a91cb09065d81e22f9d6fd (patch)
treee6221f12bdc4c48f5dc919874265633e3709559c /adei/scripts/adei-branch.sh
downloadadei-3d19ce5671e45b8e06a91cb09065d81e22f9d6fd.tar.gz
adei-3d19ce5671e45b8e06a91cb09065d81e22f9d6fd.tar.bz2
adei-3d19ce5671e45b8e06a91cb09065d81e22f9d6fd.tar.xz
adei-3d19ce5671e45b8e06a91cb09065d81e22f9d6fd.zip
Initial import
Diffstat (limited to 'adei/scripts/adei-branch.sh')
-rwxr-xr-xadei/scripts/adei-branch.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/adei/scripts/adei-branch.sh b/adei/scripts/adei-branch.sh
new file mode 100755
index 0000000..6fa8db2
--- /dev/null
+++ b/adei/scripts/adei-branch.sh
@@ -0,0 +1,51 @@
+#! /bin/bash
+
+function branch {
+ url="$1"
+ bzr branch "$url"
+}
+
+if [ ! -d /adei/src -o ! -d /adei/tmp -o ! -d /adei/sys -o ! -d /adei/cfg ]; then
+ echo "Incorrect volume configration, we expect /adei folder with populated docker volumes"
+ exit 1
+fi
+
+
+if [ ! -f /adei/src/VERSION ]; then
+ bzr branch -r $ADEI_REVISION --use-existing-dir http://darksoft.org/bzr/adei/trunk/ /adei/src
+ (
+ cd /adei/src
+ make
+
+ [ -d tmp ] && rm tmp
+ ln -s ../tmp tmp
+ chmod 0777 /adei/tmp
+
+ # Additional setups are clonned based on the environment for adei container creation
+ # but can be easily added in future. We cache all non-excluded setups. The .exclude
+ # file is removed afterwards from all
+
+ if [ ! -f /adei/cfg/config.actual.php ]; then
+
+ cp -a /opt/configs/config.*.php /adei/cfg/
+ fi
+
+ ln -s ../cfg/config.actual.php config.actual.php
+ ln -s ../cfg/config.override.php config.override.php
+ )
+fi
+
+(
+ cd /adei/src
+ for setup in $ADEI_ENABLED_SETUPS $ADEI_SETUP; do
+ if [[ ! -a setups/$setup ]]; then
+ if [[ ! -a /adei/cfg/$setup ]]; then
+ (
+ cd /adei/cfg/
+ branch "http://darksoft.org/bzr/adei/setups/$setup"
+ )
+ fi
+ ln -s ../../cfg/$setup setups/$setup
+ fi
+ done
+)