Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

script to make it easier to update live copy

  • Loading branch information...
commit 217a549d08bbe85b5f500ea2ffcb5d8b773631c6 1 parent d959152
@rspier rspier authored
Showing with 25 additions and 0 deletions.
  1. +25 −0 bin/update_live.sh
View
25 bin/update_live.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Config file format is one hostper line
+CONFIG_FILE=~/etc/perlweb_hosts.cfg
+
+if [[ ! -e ${CONFIG_FILE} ]]; then
+ echo "ERROR: ${CONFIG_FILE} does not exist" >/dev/stderr
+ exit 1;
+fi
+
+PERLWEB_HOSTS="$(cat ${CONFIG_FILE} | xargs)"
+
+echo
+echo "Perlweb Hosts: $PERLWEB_HOSTS"
+echo "Pushing live in 10 seconds..."
+echo " hit Ctrl-C if you haven't verified the content yet."
+sleep 10
+for h in ${PERLWEB_HOSTS}; do
+ echo "Updating ${h} ..."
+ if host ${h} >/dev/null 2>/dev/null; then
+ ssh -A perlweb@${h} '(cd ~/perlweb ; git pull --rebase ; git submodule update )';
+ else
+ echo "ERROR: host ${h} not found. Skipping" >/dev/stderr
+ fi
+done
Please sign in to comment.
Something went wrong with that request. Please try again.