mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-02-07 12:25:08 -05:00
Merging changes for the development scripts. Buildbot, git mirror to SourceForge and release management. No code changes.
This commit is contained in:
47
dev/scripts/buildbot.sh
Normal file
47
dev/scripts/buildbot.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
# Work around for Cron:
|
||||
USER=coolprop
|
||||
source /home/$USER/.bash_profile
|
||||
source /home/$USER/buildbot/server-master-sandbox/bin/activate
|
||||
#
|
||||
function start {
|
||||
buildbot start /home/$USER/buildbot/server-master/
|
||||
}
|
||||
function reconfig {
|
||||
buildbot reconfig /home/$USER/buildbot/server-master/
|
||||
}
|
||||
function git_pull {
|
||||
pushd /home/$USER/buildbot/CoolProp.git
|
||||
git pull
|
||||
popd
|
||||
}
|
||||
function stop {
|
||||
# PID=$(ps aux | grep -m 1 'python=buildbot.tac' | tr -s " " | cut -d " " -s -f 2)
|
||||
# if [ "$PID" -eq "$PID" ] 2>/dev/null; then
|
||||
# echo "Killing $PID"
|
||||
# kill $PID
|
||||
# fi
|
||||
buildbot stop /home/$USER/buildbot/server-master/
|
||||
}
|
||||
#
|
||||
# Check for input
|
||||
CMD="$1"
|
||||
if [ "$CMD" = "restart" ]; then
|
||||
stop
|
||||
git_pull
|
||||
start
|
||||
elif [ "$CMD" = "reconfig" ]; then
|
||||
git_pull
|
||||
reconfig
|
||||
elif [ "$CMD" = "start" ]; then
|
||||
git_pull
|
||||
start
|
||||
elif [ "$CMD" = "stop" ]; then
|
||||
stop
|
||||
else
|
||||
git_pull
|
||||
start
|
||||
fi
|
||||
#
|
||||
echo "Script executed, terminating"
|
||||
exit 0
|
||||
31
dev/scripts/gitMirror.bsh
Normal file
31
dev/scripts/gitMirror.bsh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Work around for Cron:
|
||||
USER=coolprop
|
||||
source /home/$USER/.bash_profile
|
||||
#
|
||||
SFPASS="/home/$USER/etc_opt/id_jorritw"
|
||||
#
|
||||
FOLDER="/home/$USER/src/CoolProp.git"
|
||||
ORIGIN="https://github.com/CoolProp/CoolProp.git"
|
||||
MIRROR="ssh://jorritw@git.code.sf.net/p/coolprop/git"
|
||||
#
|
||||
if [ ! -d $FOLDER ]; then # repo does not exist, clone it
|
||||
BASEFOLDER=${FOLDER%/*}
|
||||
REPOFOLDER=${FOLDER##*/}
|
||||
mkdir -p $BASEFOLDER
|
||||
pushd $BASEFOLDER
|
||||
git clone --bare $ORIGIN $REPOFOLDER
|
||||
#pushd $REPOFOLDER
|
||||
#git remote add sfmirror $MIRROR
|
||||
#popd
|
||||
popd
|
||||
fi
|
||||
echo "Preparing the ssh key for SourceForge"
|
||||
eval $(ssh-agent) # Make sure ssh-agent is running
|
||||
ssh-add "$SFPASS"
|
||||
pushd $FOLDER
|
||||
#git push --force --mirror
|
||||
git push --mirror $MIRROR
|
||||
popd
|
||||
exit 0
|
||||
@@ -5,15 +5,17 @@ if [ $# != 1 ]; then
|
||||
echo "Only one argument should be passed to this script - the version that will be released; like release.bsh 5.0.0"
|
||||
exit 1
|
||||
fi
|
||||
echo "DRYRUN=${DRYRUN}"
|
||||
echo "DRYRUN=$DRYRUN"
|
||||
CPVERSION="$1"
|
||||
BASEDIR="${HOME}/buildbot/server-master/public_html"
|
||||
BASEDIR="$HOME/buildbot/server-master/public_html"
|
||||
BINFOLDER="binaries"
|
||||
DOCFOLDER="sphinx"
|
||||
#
|
||||
#SFUSER="ibell"
|
||||
#SFPASS="${HOME}/etc_opt/id_ibell"
|
||||
#SFPASS="$HOME/etc_opt/id_ibell"
|
||||
#
|
||||
SFUSER="jorritw"
|
||||
SFPASS="${HOME}/etc_opt/id_jorritw"
|
||||
SFPASS="$HOME/etc_opt/id_jorritw"
|
||||
#
|
||||
#set -x #echo on
|
||||
# Change the folder
|
||||
@@ -21,18 +23,27 @@ pushd ${BASEDIR}
|
||||
#echo "Fixing the permissions of directories and files" # This is not needed, just ignore the perms in rsync
|
||||
#find . -type d ! -perm 0775 -exec chmod 0775 {} \;
|
||||
#find . -type f ! -perm 0664 -exec chmod 0664 {} \;
|
||||
#
|
||||
if [ "$DRYRUN" = "true" ]; then
|
||||
echo "Dry run; no zipping of the docs"
|
||||
echo "Dry run; skipping python upload"
|
||||
echo "Dry run; skipping folder date"
|
||||
RSYNC_DRY_RUN=--dry-run
|
||||
else
|
||||
echo "Zipping up the docs and moving them into the binaries folder for staging"
|
||||
echo "Zipping up the docs and moving them into the $BINFOLDER folder for staging"
|
||||
rm -f documentation.zip
|
||||
zip -rq documentation.zip sphinx/*
|
||||
mkdir -p binaries/docs
|
||||
cp documentation.zip binaries/docs
|
||||
zip -rq documentation.zip $DOCFOLDER/*
|
||||
mkdir -p "$BINFOLDER/docs"
|
||||
cp documentation.zip "$BINFOLDER/docs"
|
||||
echo "Uploading the python binaries to pypi"
|
||||
twine upload binaries/Python/*.whl binaries/Python/*.tar.gz
|
||||
twine upload $BINFOLDER/Python/*.whl $BINFOLDER/Python/*.tar.gz
|
||||
#
|
||||
NEWEST=$(find "$BINFOLDER" ! -type d -printf "%T@ %p\n" | sort -n | tail -n1)
|
||||
FDATE=${NEWEST:0:10}
|
||||
FNAME=${NEWEST:22}
|
||||
echo "Changing the folder date to the newest file date - $(date -d @$FDATE +%F)"
|
||||
touch -r "$FNAME" "$BINFOLDER"
|
||||
#
|
||||
RSYNC_DRY_RUN=
|
||||
fi
|
||||
echo "Preparing the ssh key for SourceForge"
|
||||
@@ -40,9 +51,9 @@ eval $(ssh-agent) # Make sure ssh-agent is running
|
||||
ssh-add "$SFPASS"
|
||||
#
|
||||
echo "Copying the binaries to SourceForge"
|
||||
rsync $RSYNC_DRY_RUN -a --no-perms -z --stats binaries/ ${SFUSER},coolprop@frs.sf.net:/home/pfs/project/c/co/coolprop/CoolProp/${CPVERSION}
|
||||
rsync $RSYNC_DRY_RUN -a --no-perms -z --stats "$BINFOLDER/" $SFUSER@frs.sourceforge.net:/home/frs/project/coolprop/CoolProp/$CPVERSION
|
||||
echo "Publishing the docs on SourceForge"
|
||||
rsync $RSYNC_DRY_RUN -a --no-perms -z --stats sphinx/ ${SFUSER}@web.sourceforge.net:/home/project-web/coolprop/htdocs
|
||||
rsync $RSYNC_DRY_RUN -a --no-perms -z --stats "$DOCFOLDER/" $SFUSER@web.sourceforge.net:/home/project-web/coolprop/htdocs
|
||||
# Change back to where we came from
|
||||
popd
|
||||
echo "All done, goodbye."
|
||||
|
||||
18
dev/scripts/sfManageTime.bsh
Normal file
18
dev/scripts/sfManageTime.bsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
#rsync -aP jorritw@frs.sourceforge.net:/home/frs/project/coolprop/ /home/jorrit/tmp/sourceforge/
|
||||
# Scan the tree and change the folder date to the date
|
||||
# of the oldest file in it
|
||||
#for DIR in /home/jorrit/tmp/sourceforge/CoolProp/*/; do
|
||||
for DIR in ../coolprop/CoolProp/*/; do
|
||||
NEWEST=$(find "$DIR" ! -type d -printf "%T@ %p\n" | sort -n | tail -n1)
|
||||
FDATE=${NEWEST:0:10}
|
||||
FNAME=${NEWEST:22}
|
||||
echo "$DIR: $(date -d @$FDATE +%F) of $FNAME"
|
||||
touch -r "$FNAME" "$DIR"*
|
||||
done
|
||||
# #
|
||||
# #rsync -a -f"+ */" -f"- *" /home/jorrit/tmp/sourceforge/ jorritw@frs.sourceforge.net:/home/frs/project/coolprop/
|
||||
# rsync -t /home/jorrit/tmp/sourceforge/ jorritw@frs.sourceforge.net:/home/frs/project/coolprop/
|
||||
#rsync -rtcv -f"+ */" -f"- *" /home/jorrit/tmp/sourceforge/ jorritw@frs.sourceforge.net:/home/frs/project/coolprop/
|
||||
exit 0
|
||||
Reference in New Issue
Block a user