Pastebin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash

cd /var/local/allura
git fetch origin

# TODO: use http://www.apache.org/dev/gitpubsub.html

# FIXME this doesn't pick up on branch changes or new tags
if [ `git rev-list HEAD...origin/master --count` != 0 ]; then
  echo "`date`: Deploying Allura updates."
  # update this running instance of Allura
  . /var/local/env-allura/bin/activate
  ./update.sh
  pip uninstall -y ForgeSVN  # no svn services set up on this machine
  service reactor force-stop
  service reactor start
  npm install && npm run build
  touch /etc/apache2/conf.d/allura.wsgi

  # copy used for web interface browsing
  # old way:
  #git push -f local +refs/remotes/origin/*:refs/heads/*
  #git push -f local --tags
  # new way:
  # this dir had been created with: git clone --mirror https://git-wip-us.apache.org/repos/asf/allura/git.git
  cd /var/local/repos/git/p/allura/git.git
  git remote update
  curl -L http://forge-allura.apache.org/p/allura/git/refresh

  # build and deploy docs
  cd /var/local/allura/Allura/docs
  pip install sphinx
  make clean html "SPHINXOPTS=-q"
  cp -R _build/html/* /var/www/docs/
fi

# update web interface copy of website repo
cd /var/local/repos/git/p/allura/website.git
if [[ $(git fetch 2>&1) != "" ]]; then
  git fetch 2>&1
  curl -L http://forge-allura.apache.org/p/allura/website/refresh
fi