diff --git a/.travis.yml b/.travis.yml index 3d8be581..ff4df5c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,9 @@ rvm: - "2.0.0" sudo: false cache: bundler +env: + # http://docs.travis-ci.com/user/environment-variables/#Global-Variables + global: + - BITCOINORG_BUILD_TYPE=deployment script: make travis diff --git a/_plugins/env.rb b/_plugins/env.rb new file mode 100644 index 00000000..f9dd2f01 --- /dev/null +++ b/_plugins/env.rb @@ -0,0 +1,20 @@ +# This file is licensed under the MIT License (MIT) available on +# http://opensource.org/licenses/MIT. + +## env.rb takes select environmental variables and makes them available +## to the site templates. Currently, only variables starting with +## BITCOINORG_ are exported + +module Jekyll + class EnvGenerator < Generator + def generate(site) + ## If necessary, initialize env hash table + site.config["env"] = site.config["env"] ? site.config["env"] : {} + + ## Load matching environmental variables in to array + ENV.keys.grep /^BITCOINORG_/ do |key| + site.config['env'].merge!({ key => ENV[key] }) + end + end + end +end