#!/bin/bash set -eo pipefail source /home/hmn/hmn/server/hmn.conf branch=$1 if [ -z "$branch" ]; then echo "Type the name of the branch you would like to deploy: " read branch fi echo "Deploying branch $branch..." do_as() { sudo -u $1 --preserve-env=PATH bash -s } cd /home/hmn/hmn old_rev=$(git log -1 --pretty=format:%H) do_as hmn <