mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
Add docker dev version
Add env and docker files for development Fix some random things related to rails upgrade
This commit is contained in:
parent
23b545779d
commit
11fcea3259
16 changed files with 508 additions and 402 deletions
26
.env.dev
Normal file
26
.env.dev
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
RACK_ENV=development
|
||||||
|
RAILS_ENV=development
|
||||||
|
APP_SECRET=fe837ea72667ec3d8ecb94cfba1a1bba
|
||||||
|
|
||||||
|
DEPLOY_PATH=/var/www
|
||||||
|
|
||||||
|
PUMA_WORKERS=1
|
||||||
|
PUMA_MIN_THREADS=1
|
||||||
|
PUMA_MAX_THREADS=16
|
||||||
|
PUMA_PORT=4000
|
||||||
|
PUMA_TIMEOUT=30
|
||||||
|
|
||||||
|
MYSQL_HOST=db
|
||||||
|
MYSQL_DATABASE=ensl
|
||||||
|
MYSQL_USERNAME=ensl
|
||||||
|
MYSQL_PASSWORD=ensl
|
||||||
|
MYSQL_ROOT_PASSWORD=ensl
|
||||||
|
MYSQL_CONNECTION_POOL=8
|
||||||
|
|
||||||
|
NEW_RELIC_APP_NAME=ENSL
|
||||||
|
NEW_RELIC_LICENSE_KEY=
|
||||||
|
|
||||||
|
EXCEPTIONAL_API_KEY=
|
||||||
|
|
||||||
|
GOOGLE_API_KEY=
|
||||||
|
GOOGLE_CALENDAR_ID=
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -12,6 +12,10 @@
|
||||||
*.rbc
|
*.rbc
|
||||||
*.sassc
|
*.sassc
|
||||||
|
|
||||||
|
# MySQL
|
||||||
|
db_data/
|
||||||
|
db_data*/
|
||||||
|
|
||||||
# OS X
|
# OS X
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
|
25
Dockerfile.dev
Normal file
25
Dockerfile.dev
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
FROM ruby:2.2.10
|
||||||
|
|
||||||
|
ENV RAILS_ENV development
|
||||||
|
|
||||||
|
# Add 'web' user which will run the application
|
||||||
|
RUN adduser web --home /home/web --shell /bin/bash --disabled-password --gecos ""
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get -y upgrade \
|
||||||
|
&& apt-get -y install mysql-client libmysqlclient-dev memcached nodejs \
|
||||||
|
&& service memcached start
|
||||||
|
|
||||||
|
# Separate Gemfile ADD so that `bundle install` can be cached more effectively
|
||||||
|
|
||||||
|
ADD Gemfile Gemfile.lock /var/www/
|
||||||
|
|
||||||
|
RUN mkdir -p /var/bundle && chown -R web:web /var/bundle && chown -R web:web /var/www
|
||||||
|
RUN su -c "bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4" -s /bin/bash -l web
|
||||||
|
|
||||||
|
WORKDIR /var/www
|
||||||
|
USER web
|
||||||
|
|
||||||
|
RUN bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4
|
||||||
|
|
||||||
|
USER root
|
||||||
|
CMD ["/var/www/script/entry.sh"]
|
5
Gemfile
5
Gemfile
|
@ -19,11 +19,14 @@ gem 'bluecloth', '~> 2.2.0'
|
||||||
gem 'newrelic_rpm', '~> 3.7.2.195'
|
gem 'newrelic_rpm', '~> 3.7.2.195'
|
||||||
gem 'will_paginate', '~> 3.0.5'
|
gem 'will_paginate', '~> 3.0.5'
|
||||||
gem 'dynamic_form', '~> 1.1.4'
|
gem 'dynamic_form', '~> 1.1.4'
|
||||||
gem 'i18n_country_select', '~> 1.1.5'
|
gem 'i18n_country_select'
|
||||||
|
gem 'country_select'
|
||||||
gem 'active_link_to', '~> 1.0.2'
|
gem 'active_link_to', '~> 1.0.2'
|
||||||
gem 'rmagick', '~> 2.13.4', require: false
|
gem 'rmagick', '~> 2.13.4', require: false
|
||||||
gem 'test-unit', '~> 3.1.3'
|
gem 'test-unit', '~> 3.1.3'
|
||||||
gem 'steam-condenser', github: 'koraktor/steam-condenser-ruby'
|
gem 'steam-condenser', github: 'koraktor/steam-condenser-ruby'
|
||||||
|
gem 'public_suffix', '~> 3.1.1'
|
||||||
|
gem 'active_record_union'
|
||||||
|
|
||||||
# Please install nodejs locally.
|
# Please install nodejs locally.
|
||||||
gem 'therubyracer', '~> 0.12.1' if RUBY_PLATFORM == 'x86_64-linux'
|
gem 'therubyracer', '~> 0.12.1' if RUBY_PLATFORM == 'x86_64-linux'
|
||||||
|
|
167
Gemfile.lock
167
Gemfile.lock
|
@ -1,6 +1,6 @@
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/koraktor/steam-condenser-ruby.git
|
remote: https://github.com/koraktor/steam-condenser-ruby.git
|
||||||
revision: 6bc46e5638f984765f198ad5ae4dbe38ef9341f9
|
revision: 2cb441f0518a0b8d20a017dfcc42783ae878311a
|
||||||
specs:
|
specs:
|
||||||
steam-condenser (1.3.11)
|
steam-condenser (1.3.11)
|
||||||
multi_json (~> 1.6)
|
multi_json (~> 1.6)
|
||||||
|
@ -22,8 +22,11 @@ GEM
|
||||||
activesupport (= 4.1.16)
|
activesupport (= 4.1.16)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
active_link_to (1.0.2)
|
active_link_to (1.0.5)
|
||||||
actionpack
|
actionpack
|
||||||
|
addressable
|
||||||
|
active_record_union (1.3.0)
|
||||||
|
activerecord (>= 4.0)
|
||||||
activemodel (4.1.16)
|
activemodel (4.1.16)
|
||||||
activesupport (= 4.1.16)
|
activesupport (= 4.1.16)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
|
@ -37,15 +40,17 @@ GEM
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
annotate (2.6.3)
|
addressable (2.7.0)
|
||||||
activerecord (>= 2.3.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
rake (>= 0.8.7)
|
annotate (2.6.10)
|
||||||
|
activerecord (>= 3.2, <= 4.3)
|
||||||
|
rake (~> 10.4)
|
||||||
arel (5.0.1.20140414130214)
|
arel (5.0.1.20140414130214)
|
||||||
bbcoder (1.0.1)
|
bbcoder (1.0.1)
|
||||||
better_errors (1.1.0)
|
better_errors (1.1.0)
|
||||||
coderay (>= 1.0.0)
|
coderay (>= 1.0.0)
|
||||||
erubis (>= 2.6.6)
|
erubis (>= 2.6.6)
|
||||||
binding_of_caller (0.7.2)
|
binding_of_caller (0.7.3)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
bluecloth (2.2.0)
|
bluecloth (2.2.0)
|
||||||
bourbon (3.1.8)
|
bourbon (3.1.8)
|
||||||
|
@ -59,13 +64,13 @@ GEM
|
||||||
i18n
|
i18n
|
||||||
rake (>= 10.0.0)
|
rake (>= 10.0.0)
|
||||||
sshkit (~> 1.3)
|
sshkit (~> 1.3)
|
||||||
capistrano-bundler (1.1.2)
|
capistrano-bundler (1.1.4)
|
||||||
capistrano (~> 3.0)
|
capistrano (~> 3.1)
|
||||||
sshkit (~> 1.2)
|
sshkit (~> 1.2)
|
||||||
capistrano-rails (1.1.1)
|
capistrano-rails (1.4.0)
|
||||||
capistrano (~> 3.1)
|
capistrano (~> 3.1)
|
||||||
capistrano-bundler (~> 1.1)
|
capistrano-bundler (~> 1.1)
|
||||||
capistrano-rbenv (2.0.2)
|
capistrano-rbenv (2.0.4)
|
||||||
capistrano (~> 3.1)
|
capistrano (~> 3.1)
|
||||||
sshkit (~> 1.3)
|
sshkit (~> 1.3)
|
||||||
capybara (2.4.4)
|
capybara (2.4.4)
|
||||||
|
@ -79,26 +84,33 @@ GEM
|
||||||
activesupport (>= 3.2.0)
|
activesupport (>= 3.2.0)
|
||||||
json (>= 1.7)
|
json (>= 1.7)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
childprocess (0.5.6)
|
childprocess (0.9.0)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
cliver (0.3.2)
|
cliver (0.3.2)
|
||||||
codeclimate-test-reporter (0.3.0)
|
codeclimate-test-reporter (0.3.0)
|
||||||
simplecov (>= 0.7.1, < 1.0.0)
|
simplecov (>= 0.7.1, < 1.0.0)
|
||||||
coderay (1.1.0)
|
coderay (1.1.2)
|
||||||
coffee-rails (4.0.1)
|
coffee-rails (4.0.1)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
coffee-script (2.4.1)
|
coffee-script (2.4.1)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.9.1.1)
|
coffee-script-source (1.12.2)
|
||||||
columnize (0.8.9)
|
columnize (0.9.0)
|
||||||
concurrent-ruby (1.1.5)
|
concurrent-ruby (1.1.5)
|
||||||
dalli (2.7.1)
|
countries (3.0.0)
|
||||||
|
i18n_data (~> 0.8.0)
|
||||||
|
sixarm_ruby_unaccent (~> 1.1)
|
||||||
|
unicode_utils (~> 1.4)
|
||||||
|
country_select (4.0.0)
|
||||||
|
countries (~> 3.0)
|
||||||
|
sort_alphabetical (~> 1.0)
|
||||||
|
dalli (2.7.10)
|
||||||
database_cleaner (1.2.0)
|
database_cleaner (1.2.0)
|
||||||
debug_inspector (0.0.2)
|
debug_inspector (0.0.3)
|
||||||
debugger-linecache (1.2.0)
|
debugger-linecache (1.2.0)
|
||||||
diff-lcs (1.2.5)
|
diff-lcs (1.3)
|
||||||
dotenv (0.10.0)
|
dotenv (0.10.0)
|
||||||
dotenv-rails (0.10.0)
|
dotenv-rails (0.10.0)
|
||||||
dotenv (= 0.10.0)
|
dotenv (= 0.10.0)
|
||||||
|
@ -106,74 +118,75 @@ GEM
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
exceptional (2.0.33)
|
exceptional (2.0.33)
|
||||||
rack
|
rack
|
||||||
execjs (2.6.0)
|
execjs (2.7.0)
|
||||||
factory_girl (4.4.0)
|
factory_girl (4.4.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
factory_girl_rails (4.4.1)
|
factory_girl_rails (4.4.1)
|
||||||
factory_girl (~> 4.4.0)
|
factory_girl (~> 4.4.0)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
faraday (0.9.0)
|
faraday (0.9.2)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
ffi (1.9.10)
|
ffi (1.11.1)
|
||||||
font-awesome-sass (4.1.0)
|
font-awesome-sass (4.1.0)
|
||||||
sass (~> 3.2)
|
sass (~> 3.2)
|
||||||
haml (4.0.5)
|
haml (4.0.7)
|
||||||
tilt
|
tilt
|
||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
i18n-country-translations (1.2.2)
|
i18n-country-translations (1.3.0)
|
||||||
i18n (~> 0.5)
|
i18n (~> 0.9.3)
|
||||||
railties (>= 3.0)
|
railties (~> 4.0)
|
||||||
i18n_country_select (1.1.5)
|
i18n_country_select (1.1.7)
|
||||||
i18n (~> 0.5)
|
i18n (~> 0.5)
|
||||||
i18n-country-translations (~> 1.0, >= 1.0.3)
|
i18n-country-translations (~> 1.0, >= 1.0.3)
|
||||||
unicode_utils (~> 1.0, >= 1.0.0)
|
unicode_utils (~> 1.0, >= 1.0.0)
|
||||||
|
i18n_data (0.8.0)
|
||||||
jquery-rails (2.0.3)
|
jquery-rails (2.0.3)
|
||||||
railties (>= 3.1.0, < 5.0)
|
railties (>= 3.1.0, < 5.0)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
json (1.8.3)
|
json (1.8.6)
|
||||||
libv8 (3.16.14.19)
|
libv8 (3.16.14.19)
|
||||||
mail (2.7.1)
|
mail (2.7.1)
|
||||||
mini_mime (>= 0.1.1)
|
mini_mime (>= 0.1.1)
|
||||||
method_source (0.8.2)
|
method_source (0.9.2)
|
||||||
mime-types (3.2.2)
|
mime-types (3.3)
|
||||||
mime-types-data (~> 3.2015)
|
mime-types-data (~> 3.2015)
|
||||||
mime-types-data (3.2018.0812)
|
mime-types-data (3.2019.0904)
|
||||||
mini_mime (1.0.1)
|
mini_mime (1.0.2)
|
||||||
mini_portile (0.6.2)
|
mini_portile2 (2.1.0)
|
||||||
minitest (5.11.3)
|
minitest (5.11.3)
|
||||||
multi_json (1.13.1)
|
multi_json (1.13.1)
|
||||||
multi_xml (0.5.5)
|
multi_xml (0.6.0)
|
||||||
multipart-post (2.0.0)
|
multipart-post (2.1.1)
|
||||||
mysql2 (0.3.21)
|
mysql2 (0.3.21)
|
||||||
neat (1.6.0)
|
neat (1.6.0)
|
||||||
bourbon (>= 3.1)
|
bourbon (>= 3.1)
|
||||||
sass (>= 3.3)
|
sass (>= 3.3)
|
||||||
net-scp (1.2.1)
|
net-scp (2.0.0)
|
||||||
net-ssh (>= 2.6.5)
|
net-ssh (>= 2.6.5, < 6.0.0)
|
||||||
net-ssh (2.9.0)
|
net-ssh (5.2.0)
|
||||||
newrelic_rpm (3.7.2.195)
|
newrelic_rpm (3.7.2.195)
|
||||||
nokogiri (1.6.6.2)
|
nokogiri (1.6.8.1)
|
||||||
mini_portile (~> 0.6.0)
|
mini_portile2 (~> 2.1.0)
|
||||||
oj (2.5.5)
|
oj (2.5.5)
|
||||||
poltergeist (1.6.0)
|
poltergeist (1.6.0)
|
||||||
capybara (~> 2.1)
|
capybara (~> 2.1)
|
||||||
cliver (~> 0.3.1)
|
cliver (~> 0.3.1)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
websocket-driver (>= 0.2.0)
|
websocket-driver (>= 0.2.0)
|
||||||
power_assert (0.2.4)
|
power_assert (1.1.5)
|
||||||
protected_attributes (1.1.3)
|
protected_attributes (1.1.4)
|
||||||
activemodel (>= 4.0.1, < 5.0)
|
activemodel (>= 4.0.1, < 5.0)
|
||||||
pry (0.9.12.6)
|
pry (0.12.2)
|
||||||
coderay (~> 1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.8)
|
method_source (~> 0.9.0)
|
||||||
slop (~> 3.4)
|
pry-byebug (1.3.3)
|
||||||
pry-byebug (1.3.2)
|
|
||||||
byebug (~> 2.7)
|
byebug (~> 2.7)
|
||||||
pry (~> 0.9.12)
|
pry (~> 0.10)
|
||||||
puma (2.11.1)
|
public_suffix (3.1.1)
|
||||||
|
puma (2.11.3)
|
||||||
rack (>= 1.1, < 2.0)
|
rack (>= 1.1, < 2.0)
|
||||||
quiet_assets (1.0.2)
|
quiet_assets (1.0.3)
|
||||||
railties (>= 3.1, < 5.0)
|
railties (>= 3.1, < 5.0)
|
||||||
rack (1.5.5)
|
rack (1.5.5)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
|
@ -188,14 +201,17 @@ GEM
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.1.16)
|
railties (= 4.1.16)
|
||||||
sprockets-rails (~> 2.0)
|
sprockets-rails (~> 2.0)
|
||||||
rails_autolink (1.1.5)
|
rails_autolink (1.1.6)
|
||||||
rails (> 3.1)
|
rails (> 3.1)
|
||||||
railties (4.1.16)
|
railties (4.1.16)
|
||||||
actionpack (= 4.1.16)
|
actionpack (= 4.1.16)
|
||||||
activesupport (= 4.1.16)
|
activesupport (= 4.1.16)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rake (12.3.2)
|
rake (10.5.0)
|
||||||
|
rb-fsevent (0.10.3)
|
||||||
|
rb-inotify (0.10.0)
|
||||||
|
ffi (~> 1.0)
|
||||||
ref (2.0.0)
|
ref (2.0.0)
|
||||||
rmagick (2.13.4)
|
rmagick (2.13.4)
|
||||||
rspec-core (3.3.2)
|
rspec-core (3.3.2)
|
||||||
|
@ -215,16 +231,20 @@ GEM
|
||||||
rspec-mocks (~> 3.3.0)
|
rspec-mocks (~> 3.3.0)
|
||||||
rspec-support (~> 3.3.0)
|
rspec-support (~> 3.3.0)
|
||||||
rspec-support (3.3.0)
|
rspec-support (3.3.0)
|
||||||
rubyzip (1.1.7)
|
rubyzip (1.2.4)
|
||||||
sanitize (2.1.0)
|
sanitize (2.1.1)
|
||||||
nokogiri (>= 1.4.4)
|
nokogiri (>= 1.4.4)
|
||||||
sass (3.4.16)
|
sass (3.7.4)
|
||||||
sass-rails (5.0.3)
|
sass-listen (~> 4.0.0)
|
||||||
railties (>= 4.0.0, < 5.0)
|
sass-listen (4.0.0)
|
||||||
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
|
sass-rails (5.0.7)
|
||||||
|
railties (>= 4.0.0, < 6)
|
||||||
sass (~> 3.1)
|
sass (~> 3.1)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
tilt (~> 1.1)
|
tilt (>= 1.1, < 3)
|
||||||
selenium-webdriver (2.47.1)
|
selenium-webdriver (2.47.1)
|
||||||
childprocess (~> 0.5)
|
childprocess (~> 0.5)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
|
@ -234,7 +254,9 @@ GEM
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
simplecov-html (~> 0.7.1)
|
simplecov-html (~> 0.7.1)
|
||||||
simplecov-html (0.7.1)
|
simplecov-html (0.7.1)
|
||||||
slop (3.5.0)
|
sixarm_ruby_unaccent (1.2.0)
|
||||||
|
sort_alphabetical (1.1.0)
|
||||||
|
unicode_utils (>= 1.2.2)
|
||||||
sprockets (3.7.2)
|
sprockets (3.7.2)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
|
@ -242,36 +264,32 @@ GEM
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sshkit (1.4.0)
|
sshkit (1.20.0)
|
||||||
net-scp (>= 1.1.2)
|
net-scp (>= 1.1.2)
|
||||||
net-ssh (>= 2.8.0)
|
net-ssh (>= 2.8.0)
|
||||||
term-ansicolor
|
test-unit (3.1.9)
|
||||||
term-ansicolor (1.3.0)
|
|
||||||
tins (~> 1.0)
|
|
||||||
test-unit (3.1.3)
|
|
||||||
power_assert
|
power_assert
|
||||||
therubyracer (0.12.3)
|
therubyracer (0.12.3)
|
||||||
libv8 (~> 3.16.14.15)
|
libv8 (~> 3.16.14.15)
|
||||||
ref
|
ref
|
||||||
thor (0.20.3)
|
thor (0.20.3)
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
tilt (1.4.1)
|
tilt (2.0.9)
|
||||||
timecop (0.7.1)
|
timecop (0.7.4)
|
||||||
tins (1.1.0)
|
tinymce-rails (3.5.11.1)
|
||||||
tinymce-rails (3.5.9)
|
|
||||||
railties (>= 3.1.1)
|
railties (>= 3.1.1)
|
||||||
tzinfo (1.2.5)
|
tzinfo (1.2.5)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (2.5.0)
|
uglifier (2.5.3)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
unicode_utils (1.4.0)
|
unicode_utils (1.4.0)
|
||||||
websocket (1.2.2)
|
websocket (1.2.8)
|
||||||
websocket-driver (0.5.4)
|
websocket-driver (0.7.1)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.2)
|
websocket-extensions (0.1.4)
|
||||||
will_paginate (3.0.12)
|
will_paginate (3.0.12)
|
||||||
xpath (2.0.0)
|
xpath (2.1.0)
|
||||||
nokogiri (~> 1.3)
|
nokogiri (~> 1.3)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
|
@ -279,6 +297,7 @@ PLATFORMS
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
active_link_to (~> 1.0.2)
|
active_link_to (~> 1.0.2)
|
||||||
|
active_record_union
|
||||||
annotate (~> 2.6.2)
|
annotate (~> 2.6.2)
|
||||||
bbcoder (~> 1.0.1)
|
bbcoder (~> 1.0.1)
|
||||||
better_errors (~> 1.1.0)
|
better_errors (~> 1.1.0)
|
||||||
|
@ -293,6 +312,7 @@ DEPENDENCIES
|
||||||
carrierwave (~> 0.10.0)
|
carrierwave (~> 0.10.0)
|
||||||
codeclimate-test-reporter (~> 0.3.0)
|
codeclimate-test-reporter (~> 0.3.0)
|
||||||
coffee-rails (~> 4.0.0)
|
coffee-rails (~> 4.0.0)
|
||||||
|
country_select
|
||||||
dalli (~> 2.7.0)
|
dalli (~> 2.7.0)
|
||||||
database_cleaner (~> 1.2.0)
|
database_cleaner (~> 1.2.0)
|
||||||
dotenv-rails (~> 0.10.0)
|
dotenv-rails (~> 0.10.0)
|
||||||
|
@ -302,7 +322,7 @@ DEPENDENCIES
|
||||||
faraday (~> 0.9.0)
|
faraday (~> 0.9.0)
|
||||||
font-awesome-sass (~> 4.1.0.0)
|
font-awesome-sass (~> 4.1.0.0)
|
||||||
haml (~> 4.0.5)
|
haml (~> 4.0.5)
|
||||||
i18n_country_select (~> 1.1.5)
|
i18n_country_select
|
||||||
jquery-rails (~> 2.0.2)
|
jquery-rails (~> 2.0.2)
|
||||||
mysql2 (~> 0.3.18)
|
mysql2 (~> 0.3.18)
|
||||||
neat (~> 1.6.0)
|
neat (~> 1.6.0)
|
||||||
|
@ -312,6 +332,7 @@ DEPENDENCIES
|
||||||
poltergeist (~> 1.6.0)
|
poltergeist (~> 1.6.0)
|
||||||
protected_attributes (~> 1.1.3)
|
protected_attributes (~> 1.1.3)
|
||||||
pry-byebug (~> 1.3.2)
|
pry-byebug (~> 1.3.2)
|
||||||
|
public_suffix (~> 3.1.1)
|
||||||
puma (~> 2.11.1)
|
puma (~> 2.11.1)
|
||||||
quiet_assets (~> 1.0.2)
|
quiet_assets (~> 1.0.2)
|
||||||
rails (~> 4.1.16)
|
rails (~> 4.1.16)
|
||||||
|
|
|
@ -2,7 +2,7 @@ class TeamsController < ApplicationController
|
||||||
before_filter :get_team, only: [:show, :edit, :update, :destroy, :recover]
|
before_filter :get_team, only: [:show, :edit, :update, :destroy, :recover]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@teams = Team.non_empty_teams.search(params[:search]).paginate(per_page: 80, page: params[:page]).ordered
|
@teams = Team.search(params[:search]).paginate(per_page: 80, page: params[:page]).ordered
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Team < ActiveRecord::Base
|
||||||
belongs_to :founder, :class_name => "User"
|
belongs_to :founder, :class_name => "User"
|
||||||
|
|
||||||
has_many :active_teamers, -> { where("rank >= ?", Teamer::RANK_MEMBER) }
|
has_many :active_teamers, -> { where("rank >= ?", Teamer::RANK_MEMBER) }
|
||||||
has_many :teamers, :dependent => :destroy
|
has_many :teamers, :dependent => :destroy, :counter_cache => true
|
||||||
has_many :leaders, -> { where("rank = ?", Teamer::RANK_LEADER) }, :class_name => "Teamer"
|
has_many :leaders, -> { where("rank = ?", Teamer::RANK_LEADER) }, :class_name => "Teamer"
|
||||||
has_many :contesters, :dependent => :destroy
|
has_many :contesters, :dependent => :destroy
|
||||||
has_many :contests, -> { where("contesters.active", true) }, :through => :contesters
|
has_many :contests, -> { where("contesters.active", true) }, :through => :contesters
|
||||||
|
|
|
@ -138,13 +138,8 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def country_s
|
def country_s
|
||||||
I18nCountrySelect::Countries::COUNTRY_CODES.each do |code|
|
country_object = ISO3166::Country[country]
|
||||||
if code == country
|
country_object.translations[I18n.locale.to_s] || country_object.name
|
||||||
return I18n.t(code, :scope => :countries, :default => 'missing')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
country
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def realname
|
def realname
|
||||||
|
@ -211,15 +206,15 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_messages
|
def new_messages
|
||||||
received_personal_messages.unread_by(self) + received_team_messages.unread_by(self)
|
received_personal_messages.unread_by(self).union(received_team_messages.unread_by(self))
|
||||||
end
|
end
|
||||||
|
|
||||||
def received_messages
|
def received_messages
|
||||||
received_personal_messages + received_team_messages
|
received_personal_messages.union(received_team_messages)
|
||||||
end
|
end
|
||||||
|
|
||||||
def sent_messages
|
def sent_messages
|
||||||
sent_personal_messages + sent_team_messages
|
sent_personal_messages.union(sent_team_messages)
|
||||||
end
|
end
|
||||||
|
|
||||||
def upcoming_matches
|
def upcoming_matches
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<td><%= flag team.country %></td>
|
<td><%= flag team.country %></td>
|
||||||
<td><%= namelink team %></td>
|
<td><%= namelink team %></td>
|
||||||
<td><%= h team.irc if team.irc %></td>
|
<td><%= h team.irc if team.irc %></td>
|
||||||
<td><%= h team.teamers_num %></td>
|
<td><%= h team.teamers.count %></td>
|
||||||
<% if cuser and cuser.admin? %>
|
<% if cuser and cuser.admin? %>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<%= link_to edit_team_path(team) do %>
|
<%= link_to edit_team_path(team) do %>
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
<%= link_to messages_path do %>
|
<%= link_to messages_path do %>
|
||||||
Messages <%= icon 'envelope' %>
|
Messages <%= icon 'envelope' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if c = cuser.new_messages.count > 0 %>
|
<% if c = cuser.new_messages.num > 0 %>
|
||||||
(<%= cuser.new_messages.count %>)
|
(<%= cuser.new_messages.num %>)
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
base: &db
|
base: &db
|
||||||
adapter: mysql2
|
adapter: mysql2
|
||||||
encoding: utf8
|
encoding: utf8
|
||||||
host: localhost
|
host: <%= ENV['MYSQL_HOST'] %>
|
||||||
database: <%= ENV['MYSQL_DATABASE'] %>
|
database: <%= ENV['MYSQL_DATABASE'] %>
|
||||||
username: <%= ENV['MYSQL_USERNAME'] %>
|
username: <%= ENV['MYSQL_USERNAME'] %>
|
||||||
password: <%= ENV['MYSQL_PASSWORD'] %>
|
password: <%= ENV['MYSQL_PASSWORD'] %>
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
require "dotenv"
|
require "dotenv"
|
||||||
Dotenv.load
|
Dotenv.load('.env.dev')
|
||||||
|
|
||||||
base_path = (ENV['DEPLOY_PATH'] || Dir.pwd)
|
base_path = (ENV['DEPLOY_PATH'] || Dir.pwd)
|
||||||
current_path = "#{base_path}/current"
|
#current_path = "#{base_path}/current"
|
||||||
shared_path = "#{base_path}/shared"
|
#shared_path = "#{base_path}/shared"
|
||||||
stderr_path = "#{shared_path}/log/puma.stderr.log"
|
stderr_path = "#{base_path}/log/puma.stderr.log"
|
||||||
stdout_path = "#{shared_path}/log/puma.stdout.log"
|
stdout_path = "#{base_path}/log/puma.stdout.log"
|
||||||
|
|
||||||
tag 'ENSL'
|
tag 'ENSL'
|
||||||
|
|
||||||
preload_app!
|
preload_app!
|
||||||
daemonize true
|
daemonize false
|
||||||
directory current_path
|
directory base_path
|
||||||
pidfile "#{shared_path}/tmp/pids/puma.pid"
|
pidfile "#{base_path}/tmp/pids/puma.pid"
|
||||||
state_path "#{shared_path}/tmp/pids/puma.state"
|
state_path "#{base_path}/tmp/pids/puma.state"
|
||||||
stdout_redirect stdout_path, stderr_path
|
stdout_redirect stdout_path, stderr_path
|
||||||
|
|
||||||
environment ENV['RACK_ENV'] || 'production'
|
environment ENV['RACK_ENV'] || 'production'
|
||||||
rackup DefaultRackup
|
rackup DefaultRackup
|
||||||
|
|
||||||
bind "unix://#{shared_path}/tmp/sockets/puma.sock"
|
bind "unix://#{base_path}/tmp/sockets/puma.sock"
|
||||||
port Integer(ENV['PUMA_PORT'] || 4000)
|
port Integer(ENV['PUMA_PORT'] || 4000)
|
||||||
|
|
||||||
worker_timeout Integer(ENV['PUMA_TIMEOUT'] || 30)
|
worker_timeout Integer(ENV['PUMA_TIMEOUT'] || 30)
|
||||||
|
|
5
db/migrate/20190917222520_add_teamers_count_to_teams.rb
Normal file
5
db/migrate/20190917222520_add_teamers_count_to_teams.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class AddTeamersCountToTeams < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :teams, :teamers_count, :integer
|
||||||
|
end
|
||||||
|
end
|
587
db/schema.rb
587
db/schema.rb
File diff suppressed because it is too large
Load diff
34
docker-compose.dev.yml
Normal file
34
docker-compose.dev.yml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
args:
|
||||||
|
buildno: 1
|
||||||
|
volumes:
|
||||||
|
- ".:/var/www/"
|
||||||
|
ports:
|
||||||
|
- "4000:4000"
|
||||||
|
links:
|
||||||
|
- db
|
||||||
|
- memcached
|
||||||
|
# - redis
|
||||||
|
db:
|
||||||
|
command: mysqld_safe --skip-grant-tables
|
||||||
|
image: mariadb:latest
|
||||||
|
volumes:
|
||||||
|
- "./db_data:/var/lib/mysql"
|
||||||
|
- "./ext/mysql.conf.d:/etc/mysql/conf.d"
|
||||||
|
environment:
|
||||||
|
- MYSQL_DATABASE
|
||||||
|
- MYSQL_USER
|
||||||
|
- MYSQL_USERNAME
|
||||||
|
- MYSQL_PASSWORD
|
||||||
|
- MYSQL_ROOT_PASSWORD
|
||||||
|
- MYSQL_ROOT_HOST
|
||||||
|
memcached:
|
||||||
|
image: memcached:latest
|
||||||
|
#redis:
|
||||||
|
# image: redis
|
8
script/entry.sh
Executable file
8
script/entry.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd /var/www
|
||||||
|
chown -R web:web /var/www
|
||||||
|
|
||||||
|
su -c "bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4" -s /bin/bash -l web
|
||||||
|
su -c "cd /var/www && source .env.dev && bundle exec puma -C config/puma.rb" -s /bin/bash -l web
|
||||||
|
bash
|
Loading…
Reference in a new issue