capistrano-secrets-yml 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +3 -0
- data/CHANGELOG.md +2 -0
- data/README.md +23 -8
- data/capistrano-secrets-yml.gemspec +14 -12
- data/lib/{capistrano/capistrano-secrets-yml.rb → capistrano-secrets-yml.rb} +0 -0
- data/lib/capistrano/secrets_yml/version.rb +1 -1
- data/lib/capistrano/tasks/secrets_yml.rake +3 -1
- metadata +19 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c1e2d607824ee24040560464c7edeb88607fa7d027959a0b3bb418c73d1f5e70
|
4
|
+
data.tar.gz: 8146a38f3baaa15e9f13731b678dc735cfdfb6ce7ba194008100791ebb7e71e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 668d513957b9e35bc178e57ed7d84d0f35d7ec09eecd6d4f7fade40adf1aeb7660abdfa958580a5e9ef7e92fe6971b1ee4e0c199df043947ee7fa990f6ed1590
|
7
|
+
data.tar.gz: 7659a29afce165df2d61eb66140048c61b2adee027529d760ea90d84b30f2c19b20cb11ca9bc2a1c920b98309e89d58088bf3b8f68987d8c8f2648a84b3db725
|
data/.gitignore
ADDED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -7,8 +7,8 @@ Capistrano tasks for handling `secrets.yml` when deploying Rails 4+ apps.
|
|
7
7
|
Add this to `Gemfile`:
|
8
8
|
|
9
9
|
group :development do
|
10
|
-
gem 'capistrano', '~> 3.
|
11
|
-
gem 'capistrano-secrets-yml', '~> 1.
|
10
|
+
gem 'capistrano', '~> 3.10.0'
|
11
|
+
gem 'capistrano-secrets-yml', '~> 1.1.0'
|
12
12
|
end
|
13
13
|
|
14
14
|
And then:
|
@@ -17,19 +17,23 @@ And then:
|
|
17
17
|
|
18
18
|
### Setup and usage
|
19
19
|
|
20
|
-
-
|
20
|
+
- Make sure your local `config/secrets.yml` is not git tracked. It **should be on
|
21
21
|
the disk**, but gitignored.
|
22
22
|
|
23
|
-
-
|
23
|
+
- Populate production secrets in local `config/secrets.yml`:
|
24
24
|
|
25
25
|
production:
|
26
26
|
secret_key_base: d6ced...
|
27
27
|
|
28
|
-
-
|
28
|
+
- Add to `Capfile`:
|
29
29
|
|
30
30
|
require 'capistrano/secrets_yml'
|
31
|
+
|
32
|
+
- Within your app/config/deploy/#{environment}.rb files, make sure to specify:
|
31
33
|
|
32
|
-
|
34
|
+
set :system_user, 'ssh_user' # defaults to root user; This user will SSH into the servers to generate all necessary files
|
35
|
+
|
36
|
+
- Create `secrets.yml` file on the remote server by executing this task:
|
33
37
|
|
34
38
|
$ bundle exec cap production setup
|
35
39
|
|
@@ -37,16 +41,23 @@ You can now proceed with other deployment tasks.
|
|
37
41
|
|
38
42
|
#### What if a new config is added to secrets file?
|
39
43
|
|
40
|
-
- add it
|
44
|
+
- add it to local `config/secrets.yml`:
|
41
45
|
|
42
46
|
production:
|
43
47
|
secret_key_base: d6ced...
|
44
48
|
foobar: some_other_secret
|
45
49
|
|
46
|
-
-
|
50
|
+
- if you're working in a team where other people have the deploy rights, compare
|
51
|
+
you local `secrets.yml` with the one on the server. This is to ensure you
|
52
|
+
didn't miss an update.
|
53
|
+
- copy to the server:
|
47
54
|
|
48
55
|
$ bundle exec cap production setup
|
49
56
|
|
57
|
+
- notify your colleagues that have the deploy rights that the remote
|
58
|
+
`secrets.yml` has been updated so they can change their copy.
|
59
|
+
|
60
|
+
|
50
61
|
### How it works
|
51
62
|
|
52
63
|
When you execute `$ bundle exec production setup`:
|
@@ -64,6 +75,10 @@ On deployment:
|
|
64
75
|
|
65
76
|
None.
|
66
77
|
|
78
|
+
### More Capistrano automation?
|
79
|
+
|
80
|
+
Check out [capistrano-plugins](https://github.com/capistrano-plugins) github org.
|
81
|
+
|
67
82
|
### FAQ
|
68
83
|
|
69
84
|
- shouldn't we be keeping configuration in environment variables as per
|
@@ -1,29 +1,31 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require 'capistrano/secrets_yml/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
|
-
gem.name =
|
7
|
+
gem.name = 'capistrano-secrets-yml'
|
8
8
|
gem.version = Capistrano::SecretsYml::VERSION
|
9
|
-
gem.authors = [
|
10
|
-
gem.email = [
|
11
|
-
gem.description = <<-EOF.gsub(/^\s+/,
|
9
|
+
gem.authors = ['Bruno Sutic']
|
10
|
+
gem.email = ['bruno.sutic@gmail.com']
|
11
|
+
gem.description = <<-EOF.gsub(/^\s+/, '')
|
12
12
|
Capistrano tasks for automating `secrets.yml` file handling for Rails 4+ apps.
|
13
13
|
|
14
14
|
This plugins syncs contents of your local secrets file and copies that to
|
15
15
|
the remote server.
|
16
16
|
EOF
|
17
|
-
gem.summary =
|
18
|
-
gem.homepage =
|
17
|
+
gem.summary = 'Capistrano tasks for automating `secrets.yml` file handling for Rails 4+ apps.'
|
18
|
+
gem.homepage = 'https://github.com/capistrano-plugins/capistrano-secrets-yml'
|
19
19
|
|
20
20
|
gem.files = `git ls-files`.split($/)
|
21
21
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
22
22
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
23
|
-
gem.require_paths = [
|
23
|
+
gem.require_paths = ['lib']
|
24
24
|
|
25
|
-
gem.
|
26
|
-
gem.add_dependency "sshkit", ">= 1.2.0"
|
25
|
+
gem.license = 'MIT'
|
27
26
|
|
28
|
-
gem.
|
27
|
+
gem.add_dependency 'capistrano', '~> 3.10'
|
28
|
+
gem.add_dependency 'sshkit', '~> 1.15'
|
29
|
+
|
30
|
+
gem.add_development_dependency 'rake', '~> 12.3'
|
29
31
|
end
|
File without changes
|
@@ -29,6 +29,7 @@ namespace :secrets_yml do
|
|
29
29
|
|
30
30
|
desc "secrets.yml file checks"
|
31
31
|
task :check do
|
32
|
+
raise(":deploy_to in your app/config/deploy/\#{environment}.rb file cannot contain ~") if shared_path.to_s.include?('~') # SCP doesn't support ~ in the path
|
32
33
|
invoke "secrets_yml:check_secrets_file_exists"
|
33
34
|
invoke "secrets_yml:check_git_tracking"
|
34
35
|
invoke "secrets_yml:check_config_present"
|
@@ -39,7 +40,8 @@ namespace :secrets_yml do
|
|
39
40
|
content = secrets_yml_content
|
40
41
|
on release_roles :all do
|
41
42
|
execute :mkdir, "-pv", File.dirname(secrets_yml_remote_path)
|
42
|
-
upload! StringIO.new(content), secrets_yml_remote_path
|
43
|
+
Net::SCP.upload!(self.host.hostname, fetch(:system_user), StringIO.new(content), secrets_yml_remote_path)
|
44
|
+
# upload! StringIO.new(content), secrets_yml_remote_path
|
43
45
|
end
|
44
46
|
end
|
45
47
|
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-secrets-yml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Sutic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.10'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.10'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sshkit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: '1.15'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: '1.15'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '12.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '12.3'
|
55
55
|
description: |
|
56
56
|
Capistrano tasks for automating `secrets.yml` file handling for Rails 4+ apps.
|
57
57
|
This plugins syncs contents of your local secrets file and copies that to
|
@@ -62,20 +62,22 @@ executables: []
|
|
62
62
|
extensions: []
|
63
63
|
extra_rdoc_files: []
|
64
64
|
files:
|
65
|
+
- ".gitignore"
|
65
66
|
- CHANGELOG.md
|
66
67
|
- Gemfile
|
67
68
|
- LICENSE.md
|
68
69
|
- README.md
|
69
70
|
- Rakefile
|
70
71
|
- capistrano-secrets-yml.gemspec
|
71
|
-
- lib/capistrano
|
72
|
+
- lib/capistrano-secrets-yml.rb
|
72
73
|
- lib/capistrano/secrets_yml.rb
|
73
74
|
- lib/capistrano/secrets_yml/helpers.rb
|
74
75
|
- lib/capistrano/secrets_yml/paths.rb
|
75
76
|
- lib/capistrano/secrets_yml/version.rb
|
76
77
|
- lib/capistrano/tasks/secrets_yml.rake
|
77
78
|
homepage: https://github.com/capistrano-plugins/capistrano-secrets-yml
|
78
|
-
licenses:
|
79
|
+
licenses:
|
80
|
+
- MIT
|
79
81
|
metadata: {}
|
80
82
|
post_install_message:
|
81
83
|
rdoc_options: []
|
@@ -93,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
95
|
version: '0'
|
94
96
|
requirements: []
|
95
97
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.7.3
|
97
99
|
signing_key:
|
98
100
|
specification_version: 4
|
99
101
|
summary: Capistrano tasks for automating `secrets.yml` file handling for Rails 4+
|