#!/usr/bin/env bash # # Usage: # ./publish.sh set -o nounset set -o pipefail set -o errexit proc log { echo @Argv !1 > !2 } proc versioned-dest { var branch = $[git rev-parse --abbrev-ref HEAD] log "branch $branch" var hash = $[git rev-parse $branch] var short_hash = $(hash:0:8) log "hash $short_hash" var dest = ""oilshell.org/git-branch/$branch/$short_hash"" echo $dest } proc spec { var user = $1 var host = $2 # Add hostname because spec tests aren't hermetic yet. var dest = '' set dest = ""$[versioned-dest]/$[hostname]/spec"" ssh $user@$host mkdir -p $dest # rsync is faster than scp and has the --no-target-directory behavior. # We need --copy-links because the CSS files are symlinks. rsync --archive --verbose --copy-links \ _tmp/spec/ $user@$host:$dest/ echo "Visit http://$dest/RESULTS.html" } # TODO: These should really go to the oilshell.org__deploy repo. # Publish unit tests proc unit { echo 'Hello from publish.sh' } # NOTE: Have to copy the web/ dir too? For testing, use ./local.sh # test-release-tree. proc wild { var user = $1 var host = $2 var dest = '' set dest = $[versioned-dest] # no wild/ suffix, since it's wild.wwz/ ssh $user@$host mkdir -p $dest rsync --archive --verbose \ _release/VERSION/test/wild.wwz $user@$host:$dest/ echo "Visit http://$dest/wild.wwz/" } @Argv