diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-20 10:21:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-20 10:21:57 +0200 |
commit | c7aed7b90e4f306afb1b09664de0c1e70b962f26 (patch) | |
tree | c3c1be6d4b0409b4ae693ee101933437e814dfbe /publish | |
parent | db4f4539ac99eb18bad72a184964398919b25d6d (diff) |
Add release scripts, doc
Diffstat (limited to 'publish')
-rwxr-xr-x | publish | 48 |
1 files changed, 48 insertions, 0 deletions
@@ -0,0 +1,48 @@ +#! /usr/bin/env bash + +# Publish build2 to build2.org/cppget.org. +# +# Usage: publish [<rsync-options>] +# +usage="$0 [<rsync-options>]" + +owd=`pwd` +trap "{ cd $owd; exit 1; }" ERR + +function info () { echo "$*" 1>&2; } +function error () { info "$*"; exit 1; } + +v=`sed -e 's/^\(.*\)\.\(.*\)\..*$/\1.\2/' build2-toolchain/version` + +if [ -z "$v" ]; then + error "unable to extract version from `cat build2-toolchain/version`" +fi + +d="build2-$v" + +if [ ! -d "$d" ]; then + error "distribution directory $d does not exist" +fi + +function sync () +{ + rsync -v -rlpt --copy-unsafe-links --prune-empty-dirs --delete-after $* \ +$d/ build2.org:/var/www/download.build2.org/public/$v/ + + cppget.org/publish cppget.org/repository/1/ cppget.org $* +} + +sync --dry-run $* + +r= +while [ -z "$r" ]; do + read -r -p "Continue? [yes/no]: " r + + case "$r" in + yes) ;; + no) exit 0 ;; + *) r= ;; + esac +done + +sync --progress $* |