xplenty-kensa 1.4.5
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 +6 -0
- data/.travis.yml +10 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +112 -0
- data/README.md +34 -0
- data/Rakefile +10 -0
- data/bin/kensa +92 -0
- data/lib/xplenty/kensa/check.rb +520 -0
- data/lib/xplenty/kensa/client.rb +336 -0
- data/lib/xplenty/kensa/git.rb +39 -0
- data/lib/xplenty/kensa/http.rb +57 -0
- data/lib/xplenty/kensa/manifest.rb +99 -0
- data/lib/xplenty/kensa/okjson-support.rb +24 -0
- data/lib/xplenty/kensa/okjson.rb +606 -0
- data/lib/xplenty/kensa/post_proxy.rb +33 -0
- data/lib/xplenty/kensa/screen.rb +40 -0
- data/lib/xplenty/kensa/sso.rb +133 -0
- data/lib/xplenty/kensa/version.rb +5 -0
- data/lib/xplenty/kensa.rb +10 -0
- data/test/all_check_test.rb +33 -0
- data/test/create_test.rb +46 -0
- data/test/deprovision_check_test.rb +39 -0
- data/test/helper.rb +115 -0
- data/test/init_test.rb +71 -0
- data/test/manifest_check_test.rb +123 -0
- data/test/manifest_test.rb +63 -0
- data/test/options_parsing_test.rb +65 -0
- data/test/plan_change_check_test.rb +32 -0
- data/test/provision_check_test.rb +64 -0
- data/test/provision_response_check_test.rb +81 -0
- data/test/resources/runner.rb +1 -0
- data/test/resources/server.rb +237 -0
- data/test/sso_check_test.rb +58 -0
- data/test/sso_test.rb +146 -0
- data/xplenty-kensa-1.4.4.gem +0 -0
- data/xplenty-kensa.gemspec +39 -0
- metadata +318 -0
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
kensa (1.0.0)
|
|
5
|
+
launchy (>= 0.3.2)
|
|
6
|
+
mechanize (~> 2.6.0)
|
|
7
|
+
rest-client (>= 1.4.0, < 1.7.0)
|
|
8
|
+
term-ansicolor (~> 1.0)
|
|
9
|
+
|
|
10
|
+
GEM
|
|
11
|
+
remote: https://rubygems.org/
|
|
12
|
+
specs:
|
|
13
|
+
addressable (2.3.5)
|
|
14
|
+
archive-tar-minitar (0.5.2)
|
|
15
|
+
artifice (0.6)
|
|
16
|
+
rack-test
|
|
17
|
+
colorize (0.5.8)
|
|
18
|
+
columnize (0.3.6)
|
|
19
|
+
contest (0.1.3)
|
|
20
|
+
coveralls (0.6.7)
|
|
21
|
+
colorize
|
|
22
|
+
multi_json (~> 1.3)
|
|
23
|
+
rest-client
|
|
24
|
+
simplecov (>= 0.7)
|
|
25
|
+
thor
|
|
26
|
+
domain_name (0.5.13)
|
|
27
|
+
unf (>= 0.0.5, < 1.0.0)
|
|
28
|
+
fakefs (0.4.2)
|
|
29
|
+
haml (4.0.3)
|
|
30
|
+
tilt
|
|
31
|
+
launchy (2.3.0)
|
|
32
|
+
addressable (~> 2.3)
|
|
33
|
+
linecache (0.46)
|
|
34
|
+
rbx-require-relative (> 0.0.4)
|
|
35
|
+
linecache19 (0.5.12)
|
|
36
|
+
ruby_core_source (>= 0.1.4)
|
|
37
|
+
mechanize (2.6.0)
|
|
38
|
+
domain_name (~> 0.5, >= 0.5.1)
|
|
39
|
+
mime-types (~> 1.17, >= 1.17.2)
|
|
40
|
+
net-http-digest_auth (~> 1.1, >= 1.1.1)
|
|
41
|
+
net-http-persistent (~> 2.5, >= 2.5.2)
|
|
42
|
+
nokogiri (~> 1.4)
|
|
43
|
+
ntlm-http (~> 0.1, >= 0.1.1)
|
|
44
|
+
webrobots (>= 0.0.9, < 0.2)
|
|
45
|
+
mime-types (1.24)
|
|
46
|
+
mini_portile (0.5.1)
|
|
47
|
+
multi_json (1.7.9)
|
|
48
|
+
net-http-digest_auth (1.4)
|
|
49
|
+
net-http-persistent (2.9)
|
|
50
|
+
nokogiri (1.6.0)
|
|
51
|
+
mini_portile (~> 0.5.0)
|
|
52
|
+
ntlm-http (0.1.1)
|
|
53
|
+
rack (1.5.2)
|
|
54
|
+
rack-protection (1.5.0)
|
|
55
|
+
rack
|
|
56
|
+
rack-test (0.6.2)
|
|
57
|
+
rack (>= 1.0)
|
|
58
|
+
rake (10.1.0)
|
|
59
|
+
rbx-require-relative (0.0.9)
|
|
60
|
+
rest-client (1.6.7)
|
|
61
|
+
mime-types (>= 1.16)
|
|
62
|
+
rr (1.1.2)
|
|
63
|
+
ruby-debug (0.10.4)
|
|
64
|
+
columnize (>= 0.1)
|
|
65
|
+
ruby-debug-base (~> 0.10.4.0)
|
|
66
|
+
ruby-debug-base (0.10.4)
|
|
67
|
+
linecache (>= 0.3)
|
|
68
|
+
ruby-debug-base19 (0.11.25)
|
|
69
|
+
columnize (>= 0.3.1)
|
|
70
|
+
linecache19 (>= 0.5.11)
|
|
71
|
+
ruby_core_source (>= 0.1.4)
|
|
72
|
+
ruby-debug19 (0.11.6)
|
|
73
|
+
columnize (>= 0.3.1)
|
|
74
|
+
linecache19 (>= 0.5.11)
|
|
75
|
+
ruby-debug-base19 (>= 0.11.19)
|
|
76
|
+
ruby_core_source (0.1.5)
|
|
77
|
+
archive-tar-minitar (>= 0.5.2)
|
|
78
|
+
simplecov (0.7.1)
|
|
79
|
+
multi_json (~> 1.0)
|
|
80
|
+
simplecov-html (~> 0.7.1)
|
|
81
|
+
simplecov-html (0.7.1)
|
|
82
|
+
sinatra (1.4.3)
|
|
83
|
+
rack (~> 1.4)
|
|
84
|
+
rack-protection (~> 1.4)
|
|
85
|
+
tilt (~> 1.3, >= 1.3.4)
|
|
86
|
+
term-ansicolor (1.2.2)
|
|
87
|
+
tins (~> 0.8)
|
|
88
|
+
thor (0.18.1)
|
|
89
|
+
tilt (1.4.1)
|
|
90
|
+
timecop (0.6.3)
|
|
91
|
+
tins (0.9.0)
|
|
92
|
+
unf (0.1.2)
|
|
93
|
+
unf_ext
|
|
94
|
+
unf_ext (0.0.6)
|
|
95
|
+
webrobots (0.1.1)
|
|
96
|
+
|
|
97
|
+
PLATFORMS
|
|
98
|
+
ruby
|
|
99
|
+
|
|
100
|
+
DEPENDENCIES
|
|
101
|
+
artifice
|
|
102
|
+
contest
|
|
103
|
+
coveralls
|
|
104
|
+
fakefs
|
|
105
|
+
haml
|
|
106
|
+
kensa!
|
|
107
|
+
rake
|
|
108
|
+
rr
|
|
109
|
+
ruby-debug
|
|
110
|
+
ruby-debug19
|
|
111
|
+
sinatra (>= 0.9)
|
|
112
|
+
timecop (>= 0.3.5)
|
data/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Kensa
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/xplenty/xplenty-kensa)
|
|
4
|
+
|
|
5
|
+
Xplenty Kensa is a command-line utility to help Xplenty add-on providers integrating
|
|
6
|
+
their services to Xplenty. It offers commands to create and validate manifests,
|
|
7
|
+
and to run the same API calls Xplenty runs on your service to provision and
|
|
8
|
+
deprovision resources.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Setup ######################################################################
|
|
12
|
+
|
|
13
|
+
Install it like any Ruby Gem:
|
|
14
|
+
|
|
15
|
+
$ gem install xplenty-kensa
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Usage ######################################################################
|
|
19
|
+
|
|
20
|
+
Refer to the Xplenty Add-ons Knowledgebase for more information on usage, and
|
|
21
|
+
how to build your Xplenty add-on:
|
|
22
|
+
|
|
23
|
+
<https://community.xplenty.com/knowledgebase/building-a-xplenty-add-on>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Meta #######################################################################
|
|
27
|
+
|
|
28
|
+
This is a fork of Heroku's Kensa project. Xplenty Kensa maintains API compatability with the Heroku Add-Ons API.
|
|
29
|
+
|
|
30
|
+
Oringally created by Glenn Gillen and @mattonrails.
|
|
31
|
+
|
|
32
|
+
Maintained by Xplenty.
|
|
33
|
+
|
|
34
|
+
Released under the MIT license. <https://github.com/xplenty/xplenty-kensa>
|
data/Rakefile
ADDED
data/bin/kensa
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
|
|
4
|
+
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
|
5
|
+
|
|
6
|
+
require 'rubygems'
|
|
7
|
+
require 'xplenty/kensa'
|
|
8
|
+
require 'xplenty/kensa/client'
|
|
9
|
+
|
|
10
|
+
$stdout.sync = true
|
|
11
|
+
|
|
12
|
+
include Xplenty::Kensa
|
|
13
|
+
|
|
14
|
+
begin
|
|
15
|
+
args = ARGV.dup
|
|
16
|
+
ARGV.clear
|
|
17
|
+
Client.new(args).run!
|
|
18
|
+
rescue Client::CommandInvalid => e
|
|
19
|
+
puts e.message unless e.message.empty?
|
|
20
|
+
abort File.read(__FILE__).split('__END__').last
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
__END__
|
|
24
|
+
Usage: kensa [OPTIONS] command
|
|
25
|
+
kensa init
|
|
26
|
+
kensa create <app_name> --template
|
|
27
|
+
kensa test <type> [arg1 arg2 ...]
|
|
28
|
+
kensa run <command> [arg1 arg1 ...]
|
|
29
|
+
|
|
30
|
+
OPTIONS
|
|
31
|
+
|
|
32
|
+
-f, --filename path-to-file
|
|
33
|
+
Sets the manifest file to operate on, default is addon-manifest.json.
|
|
34
|
+
|
|
35
|
+
-h, --help
|
|
36
|
+
Show this message
|
|
37
|
+
|
|
38
|
+
-p, --plan
|
|
39
|
+
Provision the specified plan instead of "test"
|
|
40
|
+
|
|
41
|
+
--async
|
|
42
|
+
Check provision call with async response.
|
|
43
|
+
|
|
44
|
+
--without-sso
|
|
45
|
+
Skip single sign-on authentication when doing provision calls
|
|
46
|
+
|
|
47
|
+
--post
|
|
48
|
+
Use HTTP POST for single sign-on instead of GET
|
|
49
|
+
|
|
50
|
+
--template
|
|
51
|
+
Name of git template on github or full url of git repo.
|
|
52
|
+
|
|
53
|
+
COMMANDS
|
|
54
|
+
|
|
55
|
+
init Creates a skeleton manifest
|
|
56
|
+
|
|
57
|
+
create <app> Clone a git repo that contains a template add-on
|
|
58
|
+
|
|
59
|
+
test <type> Simulate call from Xplenty (provision or deprovision)
|
|
60
|
+
|
|
61
|
+
run <command> Provisions a resource and runs command in returned ENV
|
|
62
|
+
|
|
63
|
+
sso <id> Launches the browser on a Xplenty session for the specified id
|
|
64
|
+
|
|
65
|
+
push Send the manifest to Xplenty
|
|
66
|
+
|
|
67
|
+
pull <id> Fetch the latest manifest from Xplenty
|
|
68
|
+
|
|
69
|
+
TEST TYPES
|
|
70
|
+
|
|
71
|
+
provision [optional params]
|
|
72
|
+
Simulate a provision call from Xplenty.
|
|
73
|
+
[optional params]
|
|
74
|
+
accepts extra command options and passes them on to the provision request
|
|
75
|
+
ie: kensa test provision --foo bar
|
|
76
|
+
|
|
77
|
+
deprovision <id>
|
|
78
|
+
Simulate a deprovision call from Xplenty.
|
|
79
|
+
|
|
80
|
+
planchange <id> <new_plan>
|
|
81
|
+
Simulate a plan change call from Xplenty.
|
|
82
|
+
|
|
83
|
+
sso <id>
|
|
84
|
+
Simulate a single sign-on call from Xplenty.
|
|
85
|
+
|
|
86
|
+
manifest
|
|
87
|
+
Confirm that the manifest is valid. Automatically runs before all tests.
|
|
88
|
+
|
|
89
|
+
all
|
|
90
|
+
runs provision, planchange, and deprovision tests.
|
|
91
|
+
defaults to using 'foo' for planchange plan.
|
|
92
|
+
|