-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·46 lines (41 loc) · 1.74 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
dir=$PWD
gem install rails --version=2.1.1 --verbose --no-rdoc --no-ri --conservative
gem install mysql --verbose --no-rdoc --no-ri --conservative
gem install mysql2 --version=0.2.18 --verbose --no-rdoc --no-ri --conservative
gem install test-unit --verbose --no-rdoc --no-ri --conservative
gem install RedCloth --verbose --no-rdoc --no-ri --conservative
gem install sparql --verbose --no-rdoc --no-ri --conservative
cd /vagrant
RUN_RAKE=1
if [ -d mushroom-observer ];
then
cd mushroom-observer
if [ "`git pull`" = "Already up-to-date." ]; then RUN_RAKE=0; fi
else
git clone https://github.com/MushroomObserver/mushroom-observer.git
cd mushroom-observer
mysql -u root -proot < db/initialize.sql # Move to config-script?
mysql -u mo -pmo mo_development < $dir/config-script/init.sql
mkdir public/images/{thumb,320,640,960,1280,orig}
fi
cp $dir/config-script/database.yml config
# Althrough it should be safe to run these, making it conditional to avoid
# a race condition with mysql becoming available. If mysql reports a failure,
# go to the vagrant box and run these rake commands by hand.
if [ "$RUN_RAKE" = 1 ]; then rake db:migrate; rake lang:update; fi
apt-get install -y -q imagemagick libmagickcore-dev libmagickwand-dev libjpeg-dev libjpeg-progs
gem install rmagick --verbose --no-rdoc --no-ri --conservative
if [ ! -f /usr/local/bin/jpegresize ];
then
gcc script/jpegresize.c -ljpeg -lm -O2 -o /usr/local/bin/jpegresize
fi
if [ ! -f /usr/local/bin/jpegexiforient ];
then
gcc script/jpegexiforient.c -o /usr/local/bin/jpegexiforient
fi
if [ ! -f /usr/local/bin/exifautotran ];
then
cp script/exifautotran.sh /usr/local/bin/exifautotran; chmod 755 /usr/local/bin/exifautotran
fi
chown -R vagrant:vagrant /vagrant/mushroom-observer