manoku 0.0.2
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.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +81 -0
- data/Rakefile +2 -0
- data/bin/manoku +4 -0
- data/lib/manoku.rb +11 -0
- data/lib/manoku/application.rb +69 -0
- data/lib/manoku/version.rb +3 -0
- data/manoku.gemspec +26 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fbc87ddefee3dc355fe45f8d92cb3846a0e50612
|
4
|
+
data.tar.gz: b661cbda9fa57d667cc2100fe51175dd880d58c7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6b42d9e425b586ef7f1a0e59e6618d2b6499ac54a2f0a400e175b30f3e2f75c5ea59b3b645f9ddd8a40c7a0952b975ad2752af4a8fac73dace07c941e3b11935
|
7
|
+
data.tar.gz: 9c417b39898021d1e8b14c95e4aec04c25dfcbc751d1a9eb589bab41078046d6f74ac0a48caf834b47d7e84b3e50314b5de2acaf99f3d874af057f8cc9f9ad85
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Jelmer Snoeck
|
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,81 @@
|
|
1
|
+
# Manoku
|
2
|
+
|
3
|
+
Manage your Heroku configuration across multiple applications with ease.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```
|
8
|
+
$ gem install manoku
|
9
|
+
```
|
10
|
+
|
11
|
+
```
|
12
|
+
$ manoku
|
13
|
+
```
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
### New
|
18
|
+
|
19
|
+
Set up an entirely new Manoku management project.
|
20
|
+
|
21
|
+
```
|
22
|
+
$ manoku new <NAME>
|
23
|
+
```
|
24
|
+
|
25
|
+
This will create a new directory.
|
26
|
+
|
27
|
+
### Init
|
28
|
+
|
29
|
+
Initialize Manoku inside an existing directory.
|
30
|
+
|
31
|
+
```
|
32
|
+
$ manoku init
|
33
|
+
```
|
34
|
+
|
35
|
+
This will create the following directory structure:
|
36
|
+
|
37
|
+
```
|
38
|
+
.
|
39
|
+
.gitignore
|
40
|
+
└── apps
|
41
|
+
├── .gitkeep
|
42
|
+
└── .git
|
43
|
+
```
|
44
|
+
|
45
|
+
To add a configuration file for the "manoku" Heroku application, you need to add `manoku.json` in the `/apps` folder.
|
46
|
+
|
47
|
+
### Add Heroku API key
|
48
|
+
|
49
|
+
To operate with Manoku you need a [Heroku Platform API key](https://github.com/heroku/platform-api#a-real-world-example).
|
50
|
+
|
51
|
+
```
|
52
|
+
$ manoku add_key <KEY>
|
53
|
+
```
|
54
|
+
|
55
|
+
This key will be stored in `~/.manoku`
|
56
|
+
|
57
|
+
### Deploy
|
58
|
+
|
59
|
+
This will deploy all configuration variables to all the applications in your `/apps` folder.
|
60
|
+
|
61
|
+
```
|
62
|
+
$ manoku deploy
|
63
|
+
```
|
64
|
+
|
65
|
+
### Download
|
66
|
+
|
67
|
+
Download an existing configuration to your application.
|
68
|
+
|
69
|
+
```
|
70
|
+
$ manoku download <APP>
|
71
|
+
```
|
72
|
+
|
73
|
+
This will create a new json file in the apps directory.
|
74
|
+
|
75
|
+
## Contributing
|
76
|
+
|
77
|
+
1. Fork it ( https://github.com/[my-github-username]/manoku/fork )
|
78
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
79
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
80
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
81
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/manoku
ADDED
data/lib/manoku.rb
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
module Manoku
|
2
|
+
class Application < Thor
|
3
|
+
package_name 'Manoku'
|
4
|
+
|
5
|
+
desc "new", "Create new Manoku project"
|
6
|
+
def new(name)
|
7
|
+
basedir = "#{workdir}/#{name.downcase.gsub(' ', '-')}"
|
8
|
+
Dir.mkdir(basedir)
|
9
|
+
init(basedir)
|
10
|
+
end
|
11
|
+
|
12
|
+
desc "init", "Initialize a Manoku configuration."
|
13
|
+
def init(base=nil)
|
14
|
+
base = workdir unless base
|
15
|
+
Git.init(base)
|
16
|
+
Dir.mkdir(appsdir)
|
17
|
+
FileUtils.touch("#{appsdir}/.gitkeep")
|
18
|
+
File.open("#{base}/.gitignore", "w") do |file|
|
19
|
+
file << "apps/*.json"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "add_key KEY", "Add Heroku API key."
|
24
|
+
def add_key(key)
|
25
|
+
@_heroku = nil
|
26
|
+
FileUtils.rm(key_file) if File.exists?(key_file)
|
27
|
+
File.open(key_file, "w") { |file| file << key }
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "deploy", "Deploy a Manoku configuration."
|
31
|
+
def deploy
|
32
|
+
Dir["#{appsdir}/*.json"].each do |path|
|
33
|
+
name = File.basename(path, '.json')
|
34
|
+
json = JSON.parse(File.read(path))
|
35
|
+
heroku.config_var.update(name, json)
|
36
|
+
puts "Updated #{name} configuration."
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "download NAME", "Download the config variables for an app."
|
41
|
+
def download(app)
|
42
|
+
File.open("#{appsdir}/#{app}.json", "w") do |file|
|
43
|
+
file << JSON.pretty_generate(heroku.config_var.info(app)).to_s
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def workdir
|
50
|
+
Dir.pwd
|
51
|
+
end
|
52
|
+
|
53
|
+
def appsdir
|
54
|
+
"#{workdir}/apps"
|
55
|
+
end
|
56
|
+
|
57
|
+
def key_file
|
58
|
+
"#{Dir.home}/.manoku"
|
59
|
+
end
|
60
|
+
|
61
|
+
def heroku
|
62
|
+
@_heroku ||= PlatformAPI.connect_oauth(heroku_key)
|
63
|
+
end
|
64
|
+
|
65
|
+
def heroku_key
|
66
|
+
File.read(key_file)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
data/manoku.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'manoku/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "manoku"
|
8
|
+
spec.version = Manoku::VERSION
|
9
|
+
spec.authors = ["Jelmer Snoeck"]
|
10
|
+
spec.email = ["jelmer.snoeck@gmail.com"]
|
11
|
+
spec.summary = %q{Heroku configuration manager.}
|
12
|
+
spec.description = %q{Manage Heroku configurations for all your applications in one spot.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = ['manoku']
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "thor"
|
22
|
+
spec.add_dependency "git"
|
23
|
+
spec.add_dependency "platform-api"
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: manoku
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jelmer Snoeck
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: git
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: platform-api
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.7'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.7'
|
69
|
+
description: Manage Heroku configurations for all your applications in one spot.
|
70
|
+
email:
|
71
|
+
- jelmer.snoeck@gmail.com
|
72
|
+
executables:
|
73
|
+
- manoku
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/manoku
|
83
|
+
- lib/manoku.rb
|
84
|
+
- lib/manoku/application.rb
|
85
|
+
- lib/manoku/version.rb
|
86
|
+
- manoku.gemspec
|
87
|
+
homepage: ''
|
88
|
+
licenses:
|
89
|
+
- MIT
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.2.2
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: Heroku configuration manager.
|
111
|
+
test_files: []
|