Blame | Last modification | View Log
#!/bin/shme=`basename "$0"`for pid in $(pidof -x $me); doif [ $pid != $$ ]; thenecho "[$(date)] : Process $me is already running with PID $pid"exit 1fidone# We use sourceforge to stash our beta/release archives# To be able to upload, you need to install sshpass (sudo apt-get install sshpass)# and after installation (first time) ssh to sourceforge so the key is accepted# ssh USERNAME@web.sourceforge.netSVN_UPLOAD_USER="USERNAME"SVN_UPLOAD_PASSWORD="PASSWORD"lowercase(){echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"}OS=`lowercase \`uname -s\``# KERNEL=`uname -r`MACH=`uname -m`archive_file="domoticz_${OS}_${MACH}.tgz"version_file="version_${OS}_${MACH}.h"history_file="history_${OS}_${MACH}.txt"# Make sure we are on latest commitecho "Updating to server revision..."git fetch --allTOTCOUNT="$(git rev-list HEAD...origin/development --count)"if [ "$TOTCOUNT" -lt 1 ]; thenecho "No Changes..."exit;figit reset --hard origin/developmentcmake -DCMAKE_BUILD_TYPE=Release .if [ $? -ne 0 ]thenecho "CMake failed!";exit 1fimake -j 2if [ $? -ne 0 ]thenecho "Compilation failed!...";exit 1fiecho "Success, making beta...";cp -f appversion.h ${version_file}cp -f History.txt ${history_file}# Generate the archiveecho "Generating Archive: ${archive_file}..."if [ -f ${archive_file} ];thenrm ${archive_file}fiif [ -f ${archive_file}.sha256sum ];thenrm ${archive_file}.sha256sumfitar -zcf ${archive_file} domoticz History.txt License.txt domoticz.sh server_cert.pem updatebeta updaterelease www/ scripts/ Config/ plugins/ dzVents/if [ $? -ne 0 ]thenecho "Error creating archive!...";exit 1fiecho "Creating checksum file...";hash="$(sha256sum ${archive_file} | sed -e 's/\s.*$//') update.tgz";echo $hash > ${archive_file}.sha256sumif [ ! -f ${archive_file}.sha256sum ];thenecho "Error creating archive checksum file!...";exit 1fi#################################echo "Uploading to SourceForge...";sshpass -p ${SVN_UPLOAD_PASSWORD} scp ${archive_file} ${archive_file}.sha256sum ${version_file} ${history_file} ${SVN_UPLOAD_USER}@web.sourceforge.net:/home/project-web/domoticz/htdocs/betaif [ $? -ne 0 ]thenecho "Error uploading to SourceForge!...";exit 1fi################################## Cleaning uprm -f ${version_file}rm -f ${history_file}echo "Done!...";exit 0;