capistrano-env-config 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ vagrant/
2
+ *.gem
3
+ *.rbc
4
+ .bundle
5
+ .config
6
+ coverage
7
+ InstalledFiles
8
+ lib/bundler/man
9
+ pkg
10
+ rdoc
11
+ spec/reports
12
+ test/tmp
13
+ test/version_tmp
14
+ tmp
15
+
16
+ # YARD artifacts
17
+ .yardoc
18
+ _yardoc
19
+ doc/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-chruby.gemspec
4
+ gemspec
@@ -0,0 +1,44 @@
1
+ # Capistrano::env-config
2
+
3
+ Loads a `.env` file in the same directory as your Capfile. Entries are automatially loaded as environment variables and can be accessed in Capistrano as ENV['VAR'] e.g.
4
+
5
+ ```ruby
6
+ # .env
7
+ GITHUB_TOKEN='foobar'
8
+
9
+
10
+ # deploy.rb
11
+
12
+ set :scm, 'git'
13
+ set :branch, 'master'
14
+ set :repo_url, 'https://github.com/rjocoleman/capistrano-env-config'
15
+ set :git_http_username, ENV['GITHUB_TOKEN']
16
+ ```
17
+
18
+ Also supports stages e.g. `.env.staging` or `.env.production`. `.env` files are loaded sequentially with the current stage first i.e. `.env.staging` first and then `.env`. If variables exist in both the stage and generic env file only the __first__ is loaded (the stage) and not overwritten.
19
+
20
+ Compatible with Capistrano 3+ only.
21
+
22
+ ## Installation
23
+
24
+ Add this line to your application's Gemfile:
25
+
26
+ gem 'capistrano', '~> 3.1'
27
+ gem 'capistrano-env-config'
28
+
29
+ And then execute:
30
+
31
+ $ bundle install
32
+
33
+ ## Usage
34
+
35
+ # Capfile
36
+ require 'capistrano-env-config
37
+
38
+ ## Contributing
39
+
40
+ 1. Fork it
41
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
42
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
43
+ 4. Push to the branch (`git push origin my-new-feature`)
44
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano-env-config/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'capistrano-env-config'
8
+ gem.version = CapistranoEnvConfig::VERSION
9
+ gem.authors = ['Robert Coleman']
10
+ gem.email = ['github@robert.net.nz']
11
+ gem.description = %q{Dotenv configuration loading for Capistrano stages}
12
+ gem.summary = %q{Dotenv configuration loading for Capistrano stages}
13
+ gem.homepage = 'https://github.com/rjocoleman/capistrano-env-config'
14
+ gem.license = 'MIT'
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ['lib']
19
+
20
+ gem.add_dependency 'capistrano', '~> 3.0'
21
+ gem.add_dependency 'dotenv', '~> 0.9'
22
+ end
@@ -0,0 +1,6 @@
1
+ # Ensure deploy tasks are loaded before we run
2
+ require 'capistrano/deploy'
3
+
4
+ require 'dotenv'
5
+
6
+ load File.expand_path('../capistrano-env-config/tasks/env_config.rake', __FILE__)
@@ -0,0 +1,5 @@
1
+ namespace :load do
2
+ task :defaults do
3
+ Dotenv.load ".env.#{fetch(:stage)}", '.env'
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module CapistranoEnvConfig
2
+ VERSION = '0.1.0'
3
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-env-config
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Robert Coleman
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-02-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: capistrano
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: dotenv
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '0.9'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '0.9'
46
+ description: Dotenv configuration loading for Capistrano stages
47
+ email:
48
+ - github@robert.net.nz
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - Gemfile
55
+ - README.md
56
+ - Rakefile
57
+ - capistrano-env-config.gemspec
58
+ - lib/capistrano-env-config.rb
59
+ - lib/capistrano-env-config/tasks/env_config.rake
60
+ - lib/capistrano-env-config/version.rb
61
+ homepage: https://github.com/rjocoleman/capistrano-env-config
62
+ licenses:
63
+ - MIT
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 1.8.23
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Dotenv configuration loading for Capistrano stages
86
+ test_files: []