~george-edison55/charms/oneiric/thinkup/update-to-1-0-2

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: Nathan Osman
  • Date: 2012-02-25 02:16:01 UTC
  • Revision ID: admin@quickmediasolutions.com-20120225021601-wzuixt3ubjt8wyqp
Switched to charm helper PPA and updated ThinkUp archive to 1.0.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
set -e
4
4
 
 
5
# Copy our helper scripts to known locations
5
6
juju-log "Copying PHP scripts"
6
7
cp opt/* /usr/bin
7
8
 
 
9
# Install the Juju helper PPA
 
10
juju-log "Adding Juju helper PPA"
 
11
add-apt-repository ppa:charmers/charm-helpers
 
12
apt-get update
 
13
 
8
14
juju-log "Installing required packages"
9
15
export DEBIAN_FRONTEND=noninteractive
10
 
apt-get install -y php5-cli libapache2-mod-php5 php5-mysql php5-curl php5-gd mysql-client postfix unzip wget
11
 
 
12
 
juju-log "Downloading ThinkUp"
13
 
wget https://github.com/downloads/ginatrapani/ThinkUp/thinkup_1.0.zip -O /tmp/thinkup.zip
14
 
 
15
 
juju-log "Verifying archive integrity"
16
 
HASH=`md5sum /tmp/thinkup.zip`
17
 
if [[ $HASH != '46f7aeab776cbd443ff15b0d38509812  /tmp/thinkup.zip' ]] ; then
18
 
    echo "Hash verification failed!"
19
 
    exit 1
 
16
apt-get install -y php5-cli libapache2-mod-php5 php5-mysql php5-curl php5-gd mysql-client postfix unzip
 
17
 
 
18
juju-log "Downloading and verifying ThinkUp"
 
19
. /usr/share/charm-helper/sh/net.sh
 
20
DOWNLOAD=`ch_get_file http://cloud.github.com/downloads/ginatrapani/ThinkUp/thinkup_1.0.2.zip 29629fd162fd53a101439229c701fc2f`
 
21
 
 
22
if [ -z "$DOWNLOAD" ]; then
 
23
        juju-log "Failed to retrieve ThinkUp archive"
 
24
        exit 1
20
25
fi
21
26
 
22
27
juju-log "Extracting ThinkUp"
23
28
cd /var/www
24
 
unzip /tmp/thinkup.zip
 
29
unzip $DOWNLOAD
25
30
 
26
31
juju-log "Relocating files to document root"
27
32
rm index.html # this file is placed by Apache, we don't need it