/admin/docker

To get this branch, use:
bzr branch http://suren.me/webbzr/admin/docker

« back to all changes in this revision

Viewing changes to adei/adei/scripts/adei-branch.sh

  • Committer: Suren A. Chilingaryan
  • Date: 2016-12-23 19:40:10 UTC
  • Revision ID: csa@suren.me-20161223194010-1013mnipk5revl6m
Initial release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
 
 
3
function branch {
 
4
    url="$1"
 
5
    bzr branch "$url"
 
6
}
 
7
 
 
8
if [ ! -d /adei/src -o ! -d /adei/tmp -o ! -d /adei/sys -o ! -d /adei/cfg  ]; then
 
9
    echo "Incorrect volume configration, we expect /adei folder with populated docker volumes"
 
10
    exit 1
 
11
fi 
 
12
 
 
13
 
 
14
if [ ! -f /adei/src/VERSION ]; then
 
15
    bzr branch -r $ADEI_REVISION --use-existing-dir http://darksoft.org/bzr/adei/trunk/ /adei/src
 
16
    (
 
17
        cd /adei/src
 
18
        make
 
19
 
 
20
        [ -d tmp ] && rm tmp
 
21
        ln -s ../tmp tmp
 
22
        chmod 0777 /adei/tmp
 
23
 
 
24
        # Additional setups are clonned based on the environment for adei container creation
 
25
        # but can be easily added in future. We cache all non-excluded setups. The .exclude
 
26
        # file is removed afterwards from all 
 
27
 
 
28
        if [ ! -f /adei/cfg/config.actual.php ]; then 
 
29
 
 
30
            cp -a /opt/configs/config.*.php /adei/cfg/
 
31
        fi
 
32
 
 
33
        ln -s ../cfg/config.actual.php config.actual.php
 
34
        ln -s ../cfg/config.override.php config.override.php
 
35
    )
 
36
fi
 
37
 
 
38
(
 
39
    cd /adei/src
 
40
    for setup in $ADEI_ENABLED_SETUPS $ADEI_SETUP; do
 
41
        if [[ ! -a setups/$setup ]]; then
 
42
            if [[ ! -a /adei/cfg/$setup ]]; then
 
43
                (
 
44
                    cd /adei/cfg/
 
45
                    branch "http://darksoft.org/bzr/adei/setups/$setup"
 
46
                )
 
47
            fi
 
48
            ln -s ../../cfg/$setup setups/$setup
 
49
        fi
 
50
    done
 
51
)