enable CardFortress in test database, #71513
[freeside.git] / bin / freeside-debian-releases.sh
1 #!/bin/bash
2
3 DISTRO="$1"
4 FS_VERSION="$2"
5 FS_REPO="$3"
6
7 if [[ $# -ne 3 ]]
8   then
9     echo "We need 3 arguments"
10     exit;
11 fi
12
13 DATE=`date +"%Y%m%d"`
14 DIR="/home/autobuild/packages/staging/freeside$FS_VERSION/$FS_REPO"
15 TARGET="/home/jeremyd/public_html/freeside$FS_VERSION-$DISTRO-$FS_REPO"
16
17 if [ ! -d "$DIR" -a -d $TARGET ]; then
18
19 echo "Staging or Target directories do not exist"
20
21 fi
22
23 GIT_VERSION=`grep '^$VERSION' $DIR/freeside/FS/FS.pm | cut -d\' -f2`
24
25 # Clean configuration file
26 rm -fr $DIR/freeside/debian/freeside-ng-selfservice.conffiles
27
28 # Pull any changes
29 cd $DIR/freeside
30 git checkout -- debian/changelog
31 git pull
32 #STATUS=`git pull`
33
34 #Assign the proper config files for freeside-ng-selfservice
35 if [ $DISTRO = "wheezy" ]; then
36         ln -s $DIR/freeside/debian/freeside-ng-selfservice.deb7 $DIR/freeside/debian/freeside-ng-selfservice.conffiles
37 else
38         ln -s $DIR/freeside/debian/freeside-ng-selfservice.deb8 $DIR/freeside/debian/freeside-ng-selfservice.conffiles
39 fi
40
41 # Add the build information to changelog
42
43 dch -b --newversion $GIT_VERSION-$DATE "Auto-Build"
44
45 # Using pbuilder and pdebuild in chroot instead of building directly : dpkg-buildpackage -b -rfakeroot -uc -us
46
47 pdebuild --pbuilderroot sudo --debbuildopts "-b -rfakeroot -uc -us" --buildresult $TARGET --architecture all -- --distribution $DISTRO  --basetgz /var/cache/pbuilder/$DISTRO.tgz
48
49 #--buildresult gets the file where it needs to be, may need to clean up DIR
50
51 cd $DIR; rm -f freeside_*
52 cd $TARGET; rm -f *.gz
53
54 $TARGET/APT