#!/bin/bash# figure out which site we're updating# assumes current siteif[ -z "$1"];thenSITE=$(echo$PWD| cut -d "/" -f5)elseSITE=$1fiif[ -z "$SITE"];thenecho"Unable to determine site to update"exit1fiecho"Site is $SITE"# figure out which branch we're updating# assumes masterif[ -z "$2"];thenBRANCH="master"elseBRANCH=$2fi# switch to demo user, change directory, and run updatesu -c "ssh-agent bash; ssh-add bitbucket; cd ~/sites/$SITE ; git pull origin $BRANCH" demo
echo"Demo user site $SITE updated with latest from $BRANCH"
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.