Permalink
Browse files

Publish static assets in web/ along with the wild test results.

  • Loading branch information...
Andy Chu
Andy Chu committed Aug 23, 2018
1 parent 507f5f9 commit 695c859550d6768c1839c8a0ec5ebdaeede0d0ae
Showing with 29 additions and 3 deletions.
  1. +29 −3 test/publish.sh
View
@@ -1,7 +1,17 @@
#!/usr/bin/env bash
#
# Temporarily publish test results under versioned directories.
#
# Usage:
# ./publish.sh <function name>
#
# Use cases:
# - Blogging
# - Shared debugging
# - Running tests on machines without a web server.
#
# Releases publish HTML the oilshell.org__deploy repo, but here we publish
# directly to web servers.
set -o nounset
set -o pipefail
@@ -11,8 +21,12 @@ log() {
echo "$@" 1>&2
}
current-branch-name() {
git rev-parse --abbrev-ref HEAD
}
versioned-dest() {
local branch=$(git rev-parse --abbrev-ref HEAD)
local branch=$(current-branch-name)
log "branch $branch"
local hash=$(git rev-parse $branch)
local short_hash=${hash:0:8}
@@ -40,8 +54,6 @@ spec() {
echo "Visit http://$dest/RESULTS.html"
}
# TODO: These should really go to the oilshell.org__deploy repo.
# Publish unit tests
unit() {
echo 'Hello from publish.sh'
@@ -71,4 +83,18 @@ wild() {
echo "Visit http://$dest/wild.wwz/"
}
# Publish static assets needed for the wild HTML pages.
web-dir() {
local user=$1
local host=${2:-${user}.org} # default host looks like the name
local branch=${3:-$(current-branch-name)}
local dest=$user@$host:oilshell.org/git-branch/$branch/web/
# This is made by copy-web in scripts/release.sh. Reuse it here.
rsync --archive --verbose \
_release/VERSION/web/ $dest
echo "Published to $dest"
}
"$@"

0 comments on commit 695c859

Please sign in to comment.