Skip to content

Instantly share code, notes, and snippets.

@jwalsh
Created October 16, 2012 18:01
Show Gist options
  • Save jwalsh/3900922 to your computer and use it in GitHub Desktop.
Save jwalsh/3900922 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Make a static clone the working copy of a Jenkins build
# to a public directory for browser testing.
# Usage:
# From within the Jenkins working copy directory.
#
# version 3 (2012-06-07)
if [ -n "$TESTSWARM_DEST" ]
then
dest=$TESTSWARM_DEST
else
[email protected]:s.wal.sh/co
fi
project=$(grep '"name":' package.json | head -n 1 | cut -d : -f 2 | cut -d '"' -f 2)
rev=$(git rev-parse HEAD)
# npm install
# grunt
HOST=$(echo $dest | cut -d ":" -f 1)
PATH=$(echo $dest | cut -d ":" -f 2)
echo ssh $HOST \"mkdir -p $PATH/$project/$rev\" '&&' rsync -vax --exclude='".git"' . $dest/$project/$rev '&&' grunt testswarm:${rev}:${HOME}/.testswarm-config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment