From ef312fdc67d6b3d558aeff41b1aa10d7f7788830 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 19 Feb 2014 11:39:15 -0500 Subject: [PATCH] Remove need for update.sh --- bootstrap.sh | 47 ++++++++++++++++++++++++++++++++--------------- update.sh | 28 ---------------------------- 2 files changed, 32 insertions(+), 43 deletions(-) delete mode 100644 update.sh diff --git a/bootstrap.sh b/bootstrap.sh index 74c823e..4e88fb4 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -2,6 +2,21 @@ # BOOSTRAP SCRIPT # Can take a single param to allow a specific branch to be installed + +usage() { echo "Usage: $0 [-s] [branch]" 1>&2; exit 1; } + +while getopts "s" o; do + case "${o}" in + s) + SETUP=true + ;; + *) + usage + ;; + esac +done +shift $((OPTIND-1)) + BRANCH=$1 # TO BE RUN AS ROOT @@ -10,26 +25,28 @@ if [[ $(/usr/bin/id -u) -ne 0 ]]; then exit fi -# SET TIMESTAMP -echo "America/New_York" | tee /etc/timezone -dpkg-reconfigure --frontend noninteractive tzdata +if [ "$SETUP" = true ] ; then + # SET TIMESTAMP + echo "America/New_York" | tee /etc/timezone + dpkg-reconfigure --frontend noninteractive tzdata -# UPGRADE ALL CURRENT PACKAGES -apt-get upgrade -y && apt-get dist-upgrade -y + # UPGRADE ALL CURRENT PACKAGES + apt-get upgrade -y && apt-get dist-upgrade -y -# INSTALL GIT -apt-get install git -y + # INSTALL GIT + apt-get install git -y -# INSTALL RUBYGEMS -apt-get install rubygems -y + # INSTALL RUBYGEMS + apt-get install rubygems -y -# INSTALL PUPPET -wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb -dpkg -i puppetlabs-release-precise.deb -apt-get update -apt-get install puppet -y + # INSTALL PUPPET + wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb + dpkg -i puppetlabs-release-precise.deb + apt-get update + apt-get install puppet -y -gem install librarian-puppet + gem install librarian-puppet +fi # CLONE PUPPET REPOSITORY cd /tmp diff --git a/update.sh b/update.sh deleted file mode 100644 index 4797f60..0000000 --- a/update.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# UPDATE SCRIPT - on a more clever day, I might merge this with bootstrap.sh -# Can take a single param to allow a specific branch to be installed -BRANCH=$1 - -# TO BE RUN AS ROOT -if [[ $(/usr/bin/id -u) -ne 0 ]]; then - echo "This script must be run as root" - exit -fi - -# CLONE PUPPET REPOSITORY -cd /tmp -rm -rf puppet -git clone https://github.com/atomaka/tc362.git puppet -cd puppet - -if [ "$BRANCH" != "" ]; then - git fetch - git checkout $BRANCH -fi - -# INSTALL MODULES -librarian-puppet install - -# RUN MANIFEST -puppet apply manifests/site.pp --modulepath=modules/