posaune
[kivitendo-erp.git] / build / kivitendo.co
1 #!/bin/bash
2 set -e
3
4 # parameter: $1: git tag to build
5 # options: -g <alternative repository>
6
7 repos="https://github.com/wagner-tech"
8 if getopts "g:" opt; then
9         repos=$OPTARG
10         shift 2
11 fi
12
13 if [ -d kivitendo-erp ]
14 then
15         pushd kivitendo-erp >/dev/null
16         branch=$(git rev-parse --abbrev-ref HEAD)
17         git pull origin $branch
18 else
19         git clone $repos/kivitendo-erp
20         pushd kivitendo-erp >/dev/null
21 fi
22         git checkout $1
23 popd >/dev/null