* Publish releases on the Nix Wiki.

svn path=/nixpkgs/trunk/; revision=620
gstqt5
Eelco Dolstra 2004-01-07 16:07:18 +00:00
parent e586e68d9b
commit 0230509c1c
1 changed files with 16 additions and 6 deletions

View File

@ -2,6 +2,8 @@
url="https://svn.cs.uu.nl:12443/repos/trace/nix/trunk/"
curl="curl -f --silent -S"
rev=$(svn log --quiet --non-interactive "$url" \
| grep '^r' \
| sed "s/r\([0-9]*\).*$/\1/" \
@ -31,22 +33,22 @@ relname=$((cd $outpath && echo nix-*.tar.bz2) | sed -e s/.tar.bz2//)
echo "release is $relname"
# If it already exists on the server, quit.
exists=$(curl -f --silent $uploader/exists/$relname)
exists=$($curl $uploader/exists/$relname)
if test "$exists" = "yes"; then
echo "server already has release $relname"
exit 0
fi
# Create an upload session on the server.
if ! sessionname=$(curl -f --silent $uploader/create/$relname); then
if ! sessionname=$($curl $uploader/create/$relname); then
echo "cannot create upload session"
exit 1
fi
echo "session name is $sessionname"
# Upload the source distribution and the manual.
curl -f --silent -T "$outpath"/nix-*.tar.bz2 "$uploader/upload/$sessionname/" || exit 1
curl -f --silent -T "$outpath"/manual.tar.bz2 "$uploader/upload-tar/$sessionname" || exit 1
$curl -T "$outpath"/nix-*.tar.bz2 "$uploader/upload/$sessionname/" || exit 1
$curl -T "$outpath"/manual.tar.bz2 "$uploader/upload-tar/$sessionname" || exit 1
# Perform a test build.
#if ! nix-store -vvvv -r "$testexpr" > /dev/null; then exit 1; fi
@ -54,7 +56,15 @@ curl -f --silent -T "$outpath"/manual.tar.bz2 "$uploader/upload-tar/$sessionname
# Perform an RPM build, and upload the RPM to the server.
if ! nix-store -vvvv -r "$rpmexpr" > /dev/null; then exit 1; fi
if ! rpmpath=$(nix-store -qn "$rpmexpr"); then exit 1; fi
curl -f --silent -T "$rpmpath"/nix-*.rpm "$uploader/upload/$sessionname/" || exit 1
$curl -T "$rpmpath"/nix-*.rpm "$uploader/upload/$sessionname/" || exit 1
# Finish the upload session.
curl -f --silent "$uploader/finish/$sessionname" || exit 1
$curl "$uploader/finish/$sessionname" || exit 1
# Publish the release on the Wiki.
echo -n $relname > relname
$curl -T relname "$uploader/put/head-revision" || exit 1
rm -f $relname
# Force a refresh of the Wiki.
$curl 'http://www.cs.uu.nl/groups/ST/twiki/bin/fresh/Trace/NixDeploymentSystem' > /dev/null || exit 1