2015-09-13 23:10:00 +02:00
|
|
|
#! /bin/sh
|
2017-10-31 20:55:05 +01:00
|
|
|
#
|
2015-09-16 23:54:41 +02:00
|
|
|
## Create an executable file and add it into `standalone` branch
|
2017-10-31 20:55:05 +01:00
|
|
|
#
|
|
|
|
# Invoke it directly on the commmit "tagged" for a release.
|
|
|
|
# Invoke it with any arg to avoid committing into `standalone` branch.
|
2015-09-13 23:10:00 +02:00
|
|
|
|
2016-07-17 22:23:20 +02:00
|
|
|
set -x
|
|
|
|
|
2015-09-13 23:10:00 +02:00
|
|
|
my_dir="$(dirname "$0")"
|
|
|
|
cd $my_dir/..
|
|
|
|
|
2015-09-14 16:14:50 +02:00
|
|
|
git_wdir="./bin/git-new-workdir"
|
|
|
|
git_wdir_url="https://raw.githubusercontent.com/git/git/master/contrib/workdir/git-new-workdir"
|
|
|
|
|
|
|
|
if [ ! -x "$git_wdir" ]; then
|
|
|
|
wget "$git_wdir_url" -O "$git_wdir"
|
|
|
|
chmod a+x "$git_wdir"
|
|
|
|
fi
|
|
|
|
|
2015-09-17 12:22:31 +02:00
|
|
|
## Ensure `standalone` branch exists (fails in travis).
|
|
|
|
git fetch pypiserver standalone:pypiserver/standalone -f && \
|
|
|
|
git branch --track standalone pypiserver/standalone
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
|
2015-09-13 23:10:00 +02:00
|
|
|
gitversion=$(git describe --tags)
|
|
|
|
rm -rf .standalone
|
2015-09-14 16:14:50 +02:00
|
|
|
if nwd_dump=$( "$git_wdir" . .standalone standalone 2>&1 ); then
|
2015-09-16 23:54:41 +02:00
|
|
|
./bin/gen-standalone.sh
|
2016-07-17 23:25:09 +02:00
|
|
|
mkdir .standalone
|
2015-09-13 23:10:00 +02:00
|
|
|
cp -p pypi-server-standalone.py .standalone
|
|
|
|
cd .standalone
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
git add .
|
2015-09-16 23:54:41 +02:00
|
|
|
git commit -m "Add pypi-server-standalone $gitversion"
|
2015-09-13 23:10:00 +02:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "git-new-workdir: failed due to: $nwd_dump"
|
|
|
|
exit 1
|
|
|
|
fi
|