~rharding/charms/precise/charmworld/update_ini

« back to all changes in this revision

Viewing changes to hooks/config-changed

  • Committer: Aaron Bentley
  • Date: 2013-01-16 21:22:04 UTC
  • mfrom: (25.1.3 restart)
  • Revision ID: aaron@canonical.com-20130116212204-bsyb94mgsnktcjhe
Restart the web site on code update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
else
22
22
    current_source_url=$(bzr config -d $project_dir parent_location)
23
23
fi
24
 
cd $project_dir
25
24
 
26
25
update_source(){
 
26
    old_dir=$(pwd)
 
27
    hooks/stop || true
 
28
    cd $project_dir
27
29
    bzr pull --overwrite $source_url -r revno:$revno
28
30
    bzr config --scope=branch "parent_location=$source_url"
29
31
    # Get any additional dependancies
32
34
    make install
33
35
    pip install pyramid_exclog
34
36
    chown ubuntu.ubuntu . -R
35
 
    if grep -E 'mongo.host = .+' production.ini; then
 
37
    if grep -E 'mongo.host = .+' $CONFIG_FILE; then
36
38
        INI=$CONFIG_FILE bin/migrations upgrade
 
39
        cd $old_dir
 
40
        hooks/start
37
41
    fi
 
42
    cd $old_dir
38
43
}
39
44
 
40
45
 
42
47
rm -f /etc/cron.d/charmworld
43
48
if [ "$source_url" != "$current_source_url" ]; then
44
49
    update_source
45
 
elif [ "$revno" -ge 0 -a $revno != $(bzr revno) ]; then
 
50
elif [ "$revno" -ge 0 -a $revno != $(bzr revno $project_dir) ]; then
46
51
    update_source
47
52
fi
48
53