~teknico/charms/precise/discourse/add-cheetah-pkg-misc-fixes

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: Marco Ceppi
  • Date: 2013-05-28 22:33:34 UTC
  • Revision ID: marco@ceppi.net-20130528223334-b76ne5wy25ku021t
Better idempotency

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
apt-get install -qy ruby1.9.3 git-core build-essential libxml2-dev \
11
11
  libxslt1-dev libpq-dev nginx redis-server postgresql-client-common \
12
 
  postgresql-client-9.1
 
12
  postgresql-client-9.1 sendmail
13
13
 
14
14
charm_dir=`pwd`
15
15
 
36
36
juju-log "Placing nginx configuration files"
37
37
rsync -az contrib/nginx/ /etc/nginx/sites-available/
38
38
rm -f /etc/nginx/sites-enabled/default
39
 
ln -s ../sites-available/discourse /etc/nginx/sites-enabled/discourse
 
39
 
 
40
if [ ! -e /etc/nginx/sites-enabled/discourse ]; then
 
41
  ln -s ../sites-available/discourse /etc/nginx/sites-enabled/discourse
 
42
fi
40
43
 
41
44
service nginx restart
42
45
 
58
61
      git pull origin $branch
59
62
    else
60
63
      juju-log "Branching $branch"
61
 
      git branch -b $branch origin/$branch
 
64
      git checkout -b $branch origin/$branch
62
65
    fi
63
66
    touch $charm_dir/.migrate
64
67
  fi
76
79
  cd /home/discourse/discourse
77
80
  if [ "$branch" != "master" ]; then
78
81
    juju-log "Moving new repository to $branch"
79
 
    git branch -b $branch origin/$branch
 
82
    git checkout -b $branch origin/$branch
80
83
  fi
81
84
 
82
85
  if [ ! -z "$tag" ]; then