2015-08-20 17:37:06 -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
|
|
|
|
|
2019-01-03 17:54:01 -07:00
|
|
|
scp matmoul@web.sourceforge.net:/home/frs/project/$prjname/release/bin/2018.06.05.01.34.45/README.txt /dev/null
|
2015-08-20 17:37:06 -06:00
|
|
|
if [ ! "$?" = "0" ]; then
|
|
|
|
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 archdi script..."
|
2015-08-29 15:44:36 -06:00
|
|
|
sed -i /^apptitle=/c\apptitle=\""Arch Linux Desktop Install (archdi) - Version: $version (GPLv3)"\" archdi
|
2015-08-20 17:44:54 -06:00
|
|
|
sed -i /version=/c\version=\""$version"\" archdi
|
2015-08-20 17:37:06 -06:00
|
|
|
|
|
|
|
echo "Set version..."
|
|
|
|
echo "$version" >version
|
|
|
|
chmod 640 version
|
|
|
|
|
|
|
|
echo "Make last commit..."
|
|
|
|
git commit -a -m "New Release : $version"
|
|
|
|
|
|
|
|
if [ ! "$branch" = "master" ]; then
|
|
|
|
echo "Merge branch $branch to master..."
|
|
|
|
git checkout master
|
2019-02-02 14:21:11 -07:00
|
|
|
git pull
|
2015-08-20 17:37:06 -06:00
|
|
|
git merge $branch
|
|
|
|
|
2015-08-29 15:44:36 -06:00
|
|
|
read -p "Delete branch $branch ? (y/N)" choice
|
2015-08-20 17:37:06 -06:00
|
|
|
case "$choice" in
|
2015-08-29 15:44:36 -06:00
|
|
|
y|Y )
|
2015-08-20 17:37:06 -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 "Create index.html..."
|
|
|
|
fle=$(cat archdi)
|
|
|
|
git checkout gh-pages
|
2019-02-02 14:21:11 -07:00
|
|
|
git pull
|
2015-08-20 17:37:06 -06:00
|
|
|
echo "$fle" > index.html
|
|
|
|
chmod 640 index.html
|
|
|
|
git commit -a -m "New Release : $version"
|
|
|
|
echo "Push index.html..."
|
|
|
|
git push
|
|
|
|
|
|
|
|
git checkout master
|
|
|
|
echo "Push release..."
|
|
|
|
git push
|
|
|
|
|
|
|
|
|
|
|
|
#Sourceforge :
|
|
|
|
|
|
|
|
targetpath=.build/$version
|
|
|
|
mkdir -p $targetpath
|
|
|
|
cp -R * $targetpath
|
|
|
|
|
|
|
|
echo "Publish release..."
|
2015-08-20 17:42:02 -06:00
|
|
|
scp -r $targetpath matmoul@web.sourceforge.net:/home/frs/project/$prjname/release/bin/
|
2015-08-20 17:37:06 -06:00
|
|
|
|
|
|
|
echo "Update redirect page..."
|
|
|
|
pubfile=.build/index.php
|
|
|
|
echo "<?php" > $pubfile
|
2015-08-20 18:00:09 -06:00
|
|
|
echo "header(\"Location: http://downloads.sourceforge.net/project/$prjname/release/bin/$version/$prjname\");" >> $pubfile
|
2015-08-20 17:37:06 -06:00
|
|
|
echo "exit;" >> $pubfile
|
|
|
|
echo "?>" >> $pubfile
|
|
|
|
scp $pubfile matmoul@web.sourceforge.net:/home/project-web/$prjname/htdocs/$prjname/index.php
|
|
|
|
scp version matmoul@web.sourceforge.net:/home/project-web/$prjname/htdocs/version
|
|
|
|
|
|
|
|
rm -R .build
|
2015-08-29 15:44:36 -06:00
|
|
|
|
|
|
|
if [ ! "$branch" = "master" ]; then
|
|
|
|
git checkout $branch
|
|
|
|
fi
|