summaryrefslogtreecommitdiff
path: root/bin/reevotech/PullPages.sh
blob: e479e39e078863c8ab52596d60e104d7b03f69ec (plain)
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
#!/bin/bash
# Use: ./bin/reevotech/PullPages.sh ecoversities Help

if [ $# -eq 0 ]
  then
    echo "Missing parameters. Use: ./bin/reevotech/PullPages.sh ecoversities Help"
    exit
fi

cd /srv/reevotech

DEPLOY=$1
DEPLOYFILE=`ls ./etc | grep $DEPLOY`
NS=$2
DOMAIN=`cat ./etc/$DEPLOYFILE  | grep 'REEVO_URL =' | cut -d'"' -f 2`

# echo $DEPLOY
# echo $DEPLOYFILE
# echo $DOMAIN

cd ./www/wiki/deployments/$DEPLOY

if [[ -d pages_tmp/$NS ]]
then
  echo ""
  cd pages_tmp/$NS
  git pull
  cd ../../
else
  git clone -c remote.origin.namespaces="$NS" mediawiki::http://$DOMAIN pages_tmp/$NS
fi

cp -rf pages_tmp/$NS pages
rm -rf pages/$NS/.git