xplenty-kensa 1.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ addon-manifest.json
2
+ coverage/
3
+ pkg/
4
+ .rvmrc
5
+ tags
6
+ test_log.txt
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ branches:
2
+ only:
3
+ - master
4
+ rvm:
5
+ - 1.8.7
6
+ - 1.9.2
7
+ - 1.9.3
8
+ notifications:
9
+ email:
10
+ - moty@xplenty.com
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+ gem 'rake'
4
+ group :development do
5
+ gem 'ruby-debug', :platforms => [:ruby_18]
6
+ gem 'ruby-debug19', :platforms => [:ruby_19]
7
+ end
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
+ [![Build Status](https://travis-ci.org/xplenty/xplenty-kensa.png?branch=master)](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
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << '.'
6
+ t.verbose = true
7
+ t.test_files = FileList["test/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
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
+