From: Erick Guan Date: Sun, 9 Nov 2014 17:45:05 +0000 (+0800) Subject: add hook and a template to use chinese gem mirror site X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=70710fa07f503adc68640e805b53630043217555;p=discourse_docker.git add hook and a template to use chinese gem mirror site --- diff --git a/templates/web.china.template.yml b/templates/web.china.template.yml new file mode 100644 index 0000000..4d59ff9 --- /dev/null +++ b/templates/web.china.template.yml @@ -0,0 +1,11 @@ +hooks: + before_web: + - exec: + cmd: + - gem sources --remove https://rubygems.org/ + - gem sources -a https://ruby.taobao.org/ + + before_bundle_exec: + - exec: + cmd: + - su discourse -c 'bundle config mirror.https://rubygems.org https://ruby.taobao.org/' diff --git a/templates/web.template.yml b/templates/web.template.yml index 532a1b1..75afd99 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -127,6 +127,11 @@ run: # ensure we are on latest bundler - gem update bundler - chown -R discourse $home + + - exec: + cd: $home + hook: bundle_exec + cmd: - su discourse -c 'bundle install --deployment --verbose --without test --without development' - su discourse -c 'bundle exec rake db:migrate' - su discourse -c 'bundle exec rake assets:precompile'