]> git.wincent.com - hextrapolate.git/commitdiff
Add high-tech deployment script
authorGreg Hurrell <greg@hurrell.net>
Tue, 4 Aug 2015 06:50:24 +0000 (23:50 -0700)
committerGreg Hurrell <greg@hurrell.net>
Tue, 4 Aug 2015 06:50:29 +0000 (23:50 -0700)
deploy.sh [new file with mode: 0755]

diff --git a/deploy.sh b/deploy.sh
new file mode 100755 (executable)
index 0000000..878aa72
--- /dev/null
+++ b/deploy.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+declare -r HOST=hex.wincent.com
+declare -r BASE=/var/www/hex.wincent.com/public_html
+
+# Upload files to staging area.
+ssh $HOST mkdir -p hextrapolate/dist
+scp index.html $HOST:hextrapolate
+scp dist/bundle.js dist/bundle.js.map $HOST:hextrapolate/dist/
+
+# Move files into final position.
+ssh -t $HOST sudo mkdir -p $BASE/dist
+ssh -t $HOST sudo cp hextrapolate/index.html $BASE/
+ssh -t $HOST sudo cp hextrapolate/dist/bundle.js hextrapolate/dist/bundle.js.map $BASE/dist/