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.
- data/.gitignore +19 -0
- data/Gemfile +4 -0
- data/README.md +44 -0
- data/Rakefile +1 -0
- data/capistrano-env-config.gemspec +22 -0
- data/lib/capistrano-env-config.rb +6 -0
- data/lib/capistrano-env-config/tasks/env_config.rake +5 -0
- data/lib/capistrano-env-config/version.rb +3 -0
- metadata +86 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -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
|
data/Rakefile
ADDED
@@ -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
|
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: []
|