Skip to content

Commit

Permalink
Fixes #31: maverick --self-update
Browse files Browse the repository at this point in the history
  • Loading branch information
fnoop committed Mar 21, 2016
1 parent 7c7e1eb commit 2772d38
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions maverick
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ fi

# Define usage function
usage () {
echo "--env=[bootstrap|dev|production] puppet environment, currently bootstrap, dev or production"
echo "--confirm this must be set to proceed, for safety"
echo "--env=[bootstrap|dev|production] Puppet environment, currently bootstrap, dev or production"
echo "--confirm This must be set to proceed, for safety"
echo "--self-update Update to latest maverick code, doesn't need --confirm"
echo
echo "WARNING: Maverick may make major changes to the system is it running on. Please do not run without understanding what it does."
echo
Expand All @@ -33,12 +34,26 @@ do
CONFIRM="true"
shift
;;
#*)
#usage
#;;
--self-update)
SELFUPDATE="true"
shift
;;
esac
done

# If self-update set, action and then exit
if [ "$SELFUPDATE" == "true" ]; then
if [ -e /srv/maverick/software/maverick/conf/puppet.conf ]; then
su mav -c "cd /srv/maverick/software/maverick; git pull origin"
echo "Maverick update completed"
echo
else
echo "Error: Maverick not found in expected location: /srv/maverick/software/maverick"
echo
fi
exit 0
fi

# Read environment marker if it exists
if [ -e /srv/maverick/.environment ]; then
environment=$(cat /srv/maverick/.environment)
Expand Down

0 comments on commit 2772d38

Please sign in to comment.