From 70710fa07f503adc68640e805b53630043217555 Mon Sep 17 00:00:00 2001 From: Erick Guan Date: Mon, 10 Nov 2014 01:45:05 +0800 Subject: [PATCH] add hook and a template to use chinese gem mirror site --- templates/web.china.template.yml | 11 +++++++++++ templates/web.template.yml | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 templates/web.china.template.yml 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' -- 2.25.1