-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathgenerate.sh
96 lines (87 loc) · 2.97 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash --login
set -e
#git checkout master
rm -rf tmp/
mkdir tmp
mkdir tmp/assets
export RAILS_ENV=production
export USE_RUBY=2.5.5
rvm install $USE_RUBY
rvm $USE_RUBY gemset create iss
rvm --force $USE_RUBY@iss gemset empty
rvm $USE_RUBY@iss do gem install bundler
cd rails3
rvm $USE_RUBY@iss do bundle install
rvm $USE_RUBY@iss do bundle exec rake assets:precompile
rvm $USE_RUBY@iss do bundle exec rake db:reset
rvm $USE_RUBY@iss do bundle exec rake db:setup
rvm $USE_RUBY@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 $USE_RUBY@iss gemset empty
rvm $USE_RUBY@iss do gem install bundler
cd rails4
rvm $USE_RUBY@iss do bundle install
rvm $USE_RUBY@iss do bundle exec rake assets:precompile
rvm $USE_RUBY@iss do bundle exec rake db:reset
rvm $USE_RUBY@iss do bundle exec rake db:setup
rvm $USE_RUBY@iss do bundle exec rails s &
sleep 10
wget -p http://localhost:3000/examples
kill %1
cp localhost\:3000/examples ../tmp/rails4.html
cp -rf localhost\:3000/assets/* ../tmp/assets/
rm -rf localhost\:3000
cd ..
echo "NOW RAILS 5"
export DISABLE_DATABASE_ENVIRONMENT_CHECK=1
rvm --force $USE_RUBY@iss gemset empty
rvm $USE_RUBY@iss do gem install bundler
cd rails5
rvm $USE_RUBY@iss do bundle install
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails assets:clobber
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails assets:precompile
RAILS_ENV=production rvm $USE_RUBY@iss do rails db:environment:set RAILS_ENV=production
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails db:reset
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails db:setup
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails s &
sleep 10
wget -p http://localhost:3000/examples
kill %1
cp localhost\:3000/examples ../tmp/rails5.html
cp -rf localhost\:3000/assets/* ../tmp/assets/
rm -rf localhost\:3000
cd ..
echo "NOW RAILS 6"
rvm --force $USE_RUBY@iss gemset empty
rvm $USE_RUBY@iss do gem install bundler
cd rails6
rvm $USE_RUBY@iss do bundle install
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails assets:clobber
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails assets:precompile
RAILS_ENV=production rvm $USE_RUBY@iss do rails db:environment:set RAILS_ENV=production
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails db:schema:load
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails db:seed
RAILS_ENV=production rvm $USE_RUBY@iss do bundle exec rails s &
sleep 10
wget -p http://localhost:3000/examples
kill %1
cp localhost\:3000/examples ../tmp/rails6.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 index.html rails3.html rails4.html rails5.html rails6.html assets/
echo "To deploy:"
echo "git commit && git push"