forked from presidentbeef/inject-some-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate.sh
54 lines (48 loc) · 1.37 KB
/
generate.sh
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
47
48
49
50
51
52
53
54
#!/bin/bash --login
set -e
#git checkout master
rm -rf tmp/
mkdir tmp
mkdir tmp/assets
rvm default gemset create iss
export RAILS_ENV=production
rvm --force default@iss gemset empty
rvm default@iss do gem install bundler
cd rails3
rvm default@iss do bundle install
rvm default@iss do bundle exec rake assets:precompile
rvm default@iss do bundle exec rake db:reset
rvm default@iss do bundle exec rake db:setup
rvm default@iss do bundle exec rails s &
sleep 10
wget -p http://localhost:3000/examples
kill %1
cp localhost\:3000/examples ../tmp/rails3.html
cp -rf localhost\:3000/assets/* ../tmp/assets/
rm -rf localhost\:3000
cd ..
echo "NOW RAILS 4"
rvm --force default@iss gemset empty
rvm default@iss do gem install bundler
cd rails4
rvm default@iss do bundle install
rvm default@iss do bundle exec rake assets:precompile
rvm default@iss do bundle exec rake db:reset
rvm default@iss do bundle exec rake db:setup
rvm default@iss do bundle exec rails s &
sleep 10
wget -p http://localhost:3000/examples
kill %1
cp localhost\:3000/examples ../tmp/rails4.html
cp localhost\:3000/examples ../tmp/index.html
cp -rf localhost\:3000/assets/* ../tmp/assets/
rm -rf localhost\:3000
cd ..
git reset --hard
git checkout gh-pages
rm -rf assets
mv tmp/* .
rm -rf tmp
git add rails3.html rails4.html assets/
echo "To deploy, add GA then:"
echo "git add rails4.html rails3.html index.html && git commit && git push"