2015-08-20 14:55:57 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
prjname=archdi
|
|
|
|
version=$(date +"%Y.%m.%d.%H.%M.%S")
|
|
|
|
branch=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
|
|
|
|
ssh -T git@github.com
|
|
|
|
if [ ! "$?" = "1" ]; then
|
|
|
|
echo "No Github ssh key loaded exiting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-08-20 15:02:33 -06:00
|
|
|
scp "matmoul@web.sourceforge.net:/home/frs/project/$prjname/README.txt" /dev/null
|
|
|
|
if [ ! "$?" = "0" ]; then
|
2015-08-20 14:55:57 -06:00
|
|
|
echo "No Sourceforge ssh key loaded exiting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
clear
|
|
|
|
read -p "Current branch is $branch. Continue ? (y/N)" choice
|
|
|
|
case "$choice" in
|
|
|
|
n|N|'' )
|
|
|
|
echo "cancel build !"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
y|Y ) echo "Begin Build Release...";;
|
|
|
|
* )
|
|
|
|
echo "cancel build !"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
echo "Building version $version..."
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
echo "Finalise lib script..."
|
|
|
|
sed -i /apptitle=/c\apptitle=\""Arch Linux Desktop Install (archdi) - Version: $version (GPLv3)"\" lib
|
2015-08-20 15:10:57 -06:00
|
|
|
sed -i /baseurl=/c\baseurl=https://raw.githubusercontent.com/MatMoul/archdi-pkg/master lib
|
2015-08-20 14:55:57 -06:00
|
|
|
|
2017-02-04 13:38:44 -07:00
|
|
|
rm pkg.tar
|
|
|
|
tar -cf pkg.tar *
|
|
|
|
|
2015-08-20 14:55:57 -06:00
|
|
|
echo "Make last commit..."
|
|
|
|
git commit -a -m "New Release : $version"
|
|
|
|
|
|
|
|
if [ ! "$branch" = "master" ]; then
|
|
|
|
echo "Merge branch $branch to master..."
|
|
|
|
git checkout master
|
|
|
|
git merge $branch
|
|
|
|
|
2015-08-21 15:14:12 -06:00
|
|
|
read -p "Delete branch $branch ? (y/N)" choice
|
2015-08-20 14:55:57 -06:00
|
|
|
case "$choice" in
|
2015-08-21 15:14:12 -06:00
|
|
|
y|Y )
|
2015-08-20 14:55:57 -06:00
|
|
|
git branch -D $branch
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
read -p "Publish to server ? (Y/n)" choice
|
|
|
|
case "$choice" in
|
|
|
|
n|N )
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "Push release..."
|
|
|
|
git push
|
|
|
|
|
|
|
|
|
|
|
|
#Sourceforge :
|
|
|
|
|
|
|
|
targetpath=.build/$version
|
|
|
|
mkdir -p $targetpath
|
|
|
|
cp -R * $targetpath
|
|
|
|
|
|
|
|
echo "Finalise lib script..."
|
|
|
|
sed -i "/baseurl=/c\baseurl=http://downloads.sourceforge.net/project/archdi/release/pkg/$version" $targetpath/lib
|
|
|
|
|
2017-02-04 13:38:44 -07:00
|
|
|
rm $targetpath/pkg.tar
|
|
|
|
tar -cf $targetpath/pkg.tar
|
|
|
|
|
2015-08-20 14:55:57 -06:00
|
|
|
echo "Publish release..."
|
|
|
|
scp -r $targetpath matmoul@web.sourceforge.net:/home/frs/project/$prjname/release/pkg/
|
|
|
|
|
2017-02-04 13:38:44 -07:00
|
|
|
echo "Update lib redirect page..."
|
2015-08-20 15:24:44 -06:00
|
|
|
pubfile=.build/index.php
|
|
|
|
echo "<?php" > $pubfile
|
|
|
|
echo "header(\"Location: http://downloads.sourceforge.net/project/$prjname/release/pkg/$version/lib\");" >> $pubfile
|
|
|
|
echo "exit;" >> $pubfile
|
|
|
|
echo "?>" >> $pubfile
|
2015-08-20 15:30:45 -06:00
|
|
|
scp $pubfile matmoul@web.sourceforge.net:/home/project-web/$prjname/htdocs/$prjname-lib/index.php
|
2015-08-20 14:55:57 -06:00
|
|
|
|
2017-02-04 13:38:44 -07:00
|
|
|
echo "Update pkg redirect page..."
|
|
|
|
pubfile=.build/index.php
|
|
|
|
echo "<?php" > $pubfile
|
|
|
|
echo "header(\"Location: http://downloads.sourceforge.net/project/$prjname/release/pkg/$version/pkg.tar\");" >> $pubfile
|
|
|
|
echo "exit;" >> $pubfile
|
|
|
|
echo "?>" >> $pubfile
|
|
|
|
scp $pubfile matmoul@web.sourceforge.net:/home/project-web/$prjname/htdocs/$prjname-pkg/index.php
|
|
|
|
|
2015-08-20 14:55:57 -06:00
|
|
|
rm -R .build
|
2015-08-29 16:40:12 -06:00
|
|
|
|
|
|
|
if [ ! "$branch" = "master" ]; then
|
|
|
|
git checkout $branch
|
|
|
|
fi
|