capistrano-ejson 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b4fc20c5bc2d2ff8d10c91f275d3187994443629
4
+ data.tar.gz: ca4ca32806819a3cc17a54247885b90067a8e3f1
5
+ SHA512:
6
+ metadata.gz: 076fa882c9dc029b0810434164d04e0894c1f6b3d3af72a1b9aeb4eacef927486367ebc82197781860b2bdc26d11a91ba65cb1278e566b7190ab414e988bdacb
7
+ data.tar.gz: 78a0ff30cfa2665422a309b61d50d5d5bd5903564cb913dfa6f6f270378b7896a7152b3e09d35ad4bb5415867c9d0f9532b5fcacd26f173522f66c1686705635
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-ejson.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Shopify
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Capistrano::EJSON
2
+
3
+ This gem makes it easy to use [ejson](https://github.com/Shopify/ejson) in applications that are deployed through Capistrano.
4
+
5
+ ## Installation
6
+
7
+ Add this lines to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'capistrano-ejson', '~> 0.0.1'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install capistrano-ejson
20
+
21
+ ## Usage
22
+
23
+ Require in `Capfile` to use the default task:
24
+
25
+ ```ruby
26
+ require 'capistrano/ejson'
27
+ ```
28
+
29
+ The task `ejson:upload_config_files` will run after `deploy:updated`.
30
+
31
+ By default any file ending in `.ejson` will be decrypted and uploaded. You can set which files to upload manually by doing
32
+
33
+ ```ruby
34
+ set :ejson_files, %w{config/keys.ejson}
35
+ ```
36
+
37
+ ## Contributing
38
+
39
+ 1. Fork it
40
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
41
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
42
+ 4. Push to the branch (`git push origin my-new-feature`)
43
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "capistrano-ejson"
7
+ spec.version = "0.0.1"
8
+ spec.authors = ["Bouke van der Bijl"]
9
+ spec.email = ["bouke@shopify.com"]
10
+ spec.description = spec.summary = %q{Automatic EJSON decryption for Capistrano}
11
+ spec.homepage = "https://github.com/Shopify/capistrano-ejson"
12
+ spec.license = "MIT"
13
+
14
+ spec.files = `git ls-files -z`.split("\x0")
15
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_dependency 'capistrano', '~> 3.1'
20
+ spec.add_dependency 'ejson', '~> 1.0', '>= 1.0.0'
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.7"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/ejson.cap', __FILE__)
@@ -0,0 +1,28 @@
1
+ namespace :ejson do
2
+ desc "Decrypt and upload ejson config files"
3
+
4
+ task :upload_config_files do
5
+ fetch(:ejson_files).each do |ejson_file|
6
+ json_file = ejson_file.sub(/\.ejson\z/, '.json')
7
+
8
+ Open3.popen3('bundle', 'exec', 'ejson', 'decrypt', ejson_file) do |stdin, stdout, stderr, wait_thr|
9
+ if wait_thr.value == 0
10
+ contents = stdout.read
11
+ on roles(:all) do
12
+ upload! StringIO.new(contents), File.join(release_path, json_file)
13
+ end
14
+ else
15
+ raise "Failed to decrypt file #{stderr.read}"
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ after 'deploy:updated', 'ejson:upload_config_files'
22
+ end
23
+
24
+ namespace :load do
25
+ task :defaults do
26
+ set :ejson_files, -> { Dir["**/*.ejson"] }
27
+ end
28
+ end
File without changes
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-ejson
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Bouke van der Bijl
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ejson
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.0.0
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '1.0'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.0.0
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.7'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.7'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '10.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '10.0'
75
+ description: Automatic EJSON decryption for Capistrano
76
+ email:
77
+ - bouke@shopify.com
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - ".gitignore"
83
+ - Gemfile
84
+ - LICENSE.txt
85
+ - README.md
86
+ - Rakefile
87
+ - capistrano-ejson.gemspec
88
+ - lib/capistrano-ejson.rb
89
+ - lib/capistrano/ejson.rb
90
+ - lib/capistrano/tasks/ejson.cap
91
+ homepage: https://github.com/Shopify/capistrano-ejson
92
+ licenses:
93
+ - MIT
94
+ metadata: {}
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project:
111
+ rubygems_version: 2.2.2
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: Automatic EJSON decryption for Capistrano
115
+ test_files: []