dokku-installer-cli 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: 49203f0b7b35398bebb943f25dd67d3f9f3520d8
4
+ data.tar.gz: 746fdd877b20fb5755531e4a9d9c89cfb24141b7
5
+ SHA512:
6
+ metadata.gz: 48a960e23f990f52d1978bc6da7709808d87f6addf00e5e52d0eb994ca5d6ac3ccb397f947edf7bc46c8624041a53596bb84a1715f295f87b02ca8c264fd26fa
7
+ data.tar.gz: d70949056c77e1b01f0177b376c8b530c2102f7d34f3b82c593e1b9c0422ee8160b63c99c1d2a063b5d4b7d90eb777ae3517e44fbe3414b12857de5c60f42a88
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ .DS_Store
2
+ results.html
3
+ pkg
4
+ html
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in dokku_installer_cli.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,48 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dokku_installer_cli (0.0.1)
5
+ methadone (~> 1.8.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ aruba (0.6.1)
11
+ childprocess (>= 0.3.6)
12
+ cucumber (>= 1.1.1)
13
+ rspec-expectations (>= 2.7.0)
14
+ builder (3.2.2)
15
+ childprocess (0.5.5)
16
+ ffi (~> 1.0, >= 1.0.11)
17
+ cucumber (1.3.17)
18
+ builder (>= 2.1.2)
19
+ diff-lcs (>= 1.1.3)
20
+ gherkin (~> 2.12)
21
+ multi_json (>= 1.7.5, < 2.0)
22
+ multi_test (>= 0.1.1)
23
+ diff-lcs (1.2.5)
24
+ ffi (1.9.6)
25
+ gherkin (2.12.2)
26
+ multi_json (~> 1.3)
27
+ json (1.8.1)
28
+ methadone (1.8.0)
29
+ bundler
30
+ multi_json (1.10.1)
31
+ multi_test (0.1.1)
32
+ rake (10.3.2)
33
+ rdoc (4.1.2)
34
+ json (~> 1.4)
35
+ rspec-expectations (3.1.2)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.1.0)
38
+ rspec-support (3.1.2)
39
+
40
+ PLATFORMS
41
+ ruby
42
+
43
+ DEPENDENCIES
44
+ aruba
45
+ bundler (~> 1.7)
46
+ dokku_installer_cli!
47
+ rake
48
+ rdoc
data/LICENSE.txt ADDED
@@ -0,0 +1,8 @@
1
+ Name: dokku_installer_cli
2
+ Copyright (c) 2014 Brian Pattison
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # DokkuInstallerCli
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'dokku_installer_cli'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install dokku_installer_cli
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/dokku_installer_cli/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/README.rdoc ADDED
@@ -0,0 +1,23 @@
1
+ = dokku_installer_cli - DESCRIBE YOUR GEM
2
+
3
+ Author:: YOUR NAME (YOUR EMAIL)
4
+ Copyright:: Copyright (c) 2014 YOUR NAME
5
+
6
+
7
+ License:: mit, see LICENSE.txt
8
+
9
+
10
+
11
+ DESCRIBE YOUR GEM HERE
12
+
13
+ == Links
14
+
15
+ * {Source on Github}[LINK TO GITHUB]
16
+ * RDoc[LINK TO RDOC.INFO]
17
+
18
+ == Install
19
+
20
+ == Examples
21
+
22
+ == Contributing
23
+
data/Rakefile ADDED
@@ -0,0 +1,61 @@
1
+ def dump_load_path
2
+ puts $LOAD_PATH.join("\n")
3
+ found = nil
4
+ $LOAD_PATH.each do |path|
5
+ if File.exists?(File.join(path,"rspec"))
6
+ puts "Found rspec in #{path}"
7
+ if File.exists?(File.join(path,"rspec","core"))
8
+ puts "Found core"
9
+ if File.exists?(File.join(path,"rspec","core","rake_task"))
10
+ puts "Found rake_task"
11
+ found = path
12
+ else
13
+ puts "!! no rake_task"
14
+ end
15
+ else
16
+ puts "!!! no core"
17
+ end
18
+ end
19
+ end
20
+ if found.nil?
21
+ puts "Didn't find rspec/core/rake_task anywhere"
22
+ else
23
+ puts "Found in #{path}"
24
+ end
25
+ end
26
+ require 'bundler'
27
+ require 'rake/clean'
28
+
29
+ require 'rake/testtask'
30
+
31
+ require 'cucumber'
32
+ require 'cucumber/rake/task'
33
+ gem 'rdoc' # we need the installed RDoc gem, not the system one
34
+ require 'rdoc/task'
35
+
36
+ include Rake::DSL
37
+
38
+ Bundler::GemHelper.install_tasks
39
+
40
+
41
+ Rake::TestTask.new do |t|
42
+ t.pattern = 'test/tc_*.rb'
43
+ end
44
+
45
+
46
+ CUKE_RESULTS = 'results.html'
47
+ CLEAN << CUKE_RESULTS
48
+ Cucumber::Rake::Task.new(:features) do |t|
49
+ t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty --no-source -x"
50
+ t.fork = false
51
+ end
52
+
53
+ Rake::RDocTask.new do |rd|
54
+
55
+ rd.main = "README.rdoc"
56
+
57
+ rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
58
+ end
59
+
60
+ task :default => [:test,:features]
61
+
data/bin/dokku ADDED
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "optparse"
4
+ require "methadone"
5
+ require "dokku_installer_cli.rb"
6
+
7
+ class App
8
+ include Methadone::Main
9
+ include Methadone::CLILogging
10
+
11
+ main do |command, *args|
12
+ git_config = File.join(Dir.pwd, ".git", "config")
13
+ exit unless File.exist?(git_config)
14
+
15
+ git_config = File.read(git_config)
16
+ match = git_config.match(/url \= dokku@(.*):(.*)\n/).to_a
17
+ exit unless match
18
+
19
+ domain = match[1]
20
+ app_name = match[2]
21
+
22
+ dokku_command = "ssh -t dokku@#{domain} "
23
+
24
+ case command
25
+ when "config"
26
+ dokku_command += "config #{app_name}"
27
+ when "config:get"
28
+ dokku_command += "config:get #{app_name} #{args.first}"
29
+ when "config:set"
30
+ dokku_command += "config:set #{app_name} #{args.join(' ')}"
31
+ when "config:unset"
32
+ dokku_command += "config:unset #{app_name} #{args.join(' ')}"
33
+ when "create"
34
+ dokku_command += "create #{args.first}"
35
+ when "domains"
36
+ dokku_command += "domains #{app_name}"
37
+ when "domains:set"
38
+ dokku_command += "domains:set #{app_name} #{args.join(' ')}"
39
+ when "logs"
40
+ dokku_command += "logs #{app_name} #{args.join(' ')}"
41
+ when "run"
42
+ command = args.join(' ')
43
+ dokku_command += "run #{app_name} #{command}"
44
+ puts "Running #{command}..."
45
+ end
46
+
47
+ exec(dokku_command)
48
+ end
49
+
50
+ # backup:export [file] Export dokku configuration files
51
+ # backup:import [file] Import dokku configuration files
52
+ # config <app> Display the config vars for an app
53
+ # config:get <app> KEY Display a config value for an app
54
+ # config:set <app> KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars
55
+ # config:unset <app> KEY1 [KEY2 ...] Unset one or more config vars
56
+ # create <app> Create an app
57
+ # delete <app> Delete an application
58
+ # domains <app> Display the domains for an app
59
+ # domains:set <app> DOMAIN1 [DOMAIN2 ...] Set one or more domains
60
+ # help Print the list of commands
61
+ # logs <app> [-t] Show the last logs for an application (-t follows)
62
+ # plugins-install Install active plugins
63
+ # plugins Print active plugins
64
+ # postgres:console <db> Open a PostgreSQL console
65
+ # postgres:create <db> Create a PostgreSQL container
66
+ # postgres:delete <db> Delete specified PostgreSQL container
67
+ # postgres:dump <db> > dump_file.sql Dump database data
68
+ # postgres:info <db> Display database informations
69
+ # postgres:link <app> <db> Link an app to a PostgreSQL database
70
+ # postgres:list Display list of PostgreSQL containers
71
+ # postgres:logs <db> Display last logs from PostgreSQL container
72
+ # postgres:restore <db> < dump_file.sql Restore database data from a previous dump
73
+ # redis:create <rd> Create a Redis container
74
+ # redis:delete <rd> Delete specified Redis container
75
+ # redis:info <rd> Display container information
76
+ # redis:link <app> <rd> Link an app to a Redis container
77
+ # redis:logs <rd> Display last logs from Redis container
78
+ # run <app> <cmd> Run a command in the environment of an application
79
+ # url <app> Show the URL for an application
80
+ # version Print dokku's version
81
+
82
+ # supplemental methods here
83
+
84
+ # Declare command-line interface here
85
+
86
+ # description "one line description of your app"
87
+ #
88
+ # Accept flags via:
89
+ # on("--flag VAL","Some flag")
90
+ # options[flag] will contain VAL
91
+ #
92
+ # Specify switches via:
93
+ # on("--[no-]switch","Some switch")
94
+ #
95
+ # Or, just call OptionParser methods on opts
96
+ #
97
+ # Require an argument
98
+ # arg :some_arg
99
+ #
100
+ # # Make an argument optional
101
+ # arg :optional_arg, :optional
102
+
103
+ version DokkuInstallerCli::VERSION
104
+
105
+ use_log_level_option :toggle_debug_on_signal => "USR1"
106
+
107
+ go!
108
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "dokku_installer_cli/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "dokku-installer-cli"
8
+ spec.version = DokkuInstallerCli::VERSION
9
+ spec.authors = ["Brian Pattison"]
10
+ spec.email = ["brian@brianpattison.com"]
11
+ spec.summary = %q{Command line tool for Dokku Installer}
12
+ spec.homepage = "https://github.com/brianpattison/dokku-installer-cli"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency "methadone", "~> 1.8.0"
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.7"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "aruba", "~> 0.6"
25
+ end
@@ -0,0 +1,13 @@
1
+ Feature: My bootstrapped app kinda works
2
+ In order to get going on coding my awesome app
3
+ I want to have aruba and cucumber setup
4
+ So I don't have to do it myself
5
+
6
+ Scenario: App just runs
7
+ When I get help for "dokku_installer_cli"
8
+ Then the exit status should be 0
9
+ And the banner should be present
10
+ And the banner should document that this app takes options
11
+ And the following options should be documented:
12
+ |--version|
13
+ And the banner should document that this app takes no arguments
@@ -0,0 +1 @@
1
+ # Put your step definitions here
@@ -0,0 +1,16 @@
1
+ require 'aruba/cucumber'
2
+ require 'methadone/cucumber'
3
+
4
+ ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
5
+ LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
6
+
7
+ Before do
8
+ # Using "announce" causes massive warnings on 1.9.2
9
+ @puts = true
10
+ @original_rubylib = ENV['RUBYLIB']
11
+ ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
12
+ end
13
+
14
+ After do
15
+ ENV['RUBYLIB'] = @original_rubylib
16
+ end
@@ -0,0 +1,5 @@
1
+ require "dokku_installer_cli/version"
2
+
3
+ module DokkuInstallerCli
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,3 @@
1
+ module DokkuInstallerCli
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,7 @@
1
+ require 'test/unit'
2
+
3
+ class TestSomething < Test::Unit::TestCase
4
+ def test_truth
5
+ assert true
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dokku-installer-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Brian Pattison
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: methadone
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.8.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.8.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: aruba
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.6'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.6'
69
+ description:
70
+ email:
71
+ - brian@brianpattison.com
72
+ executables:
73
+ - dokku
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - Gemfile
79
+ - Gemfile.lock
80
+ - LICENSE.txt
81
+ - README.md
82
+ - README.rdoc
83
+ - Rakefile
84
+ - bin/dokku
85
+ - dokku_installer_cli.gemspec
86
+ - features/dokku_installer_cli.feature
87
+ - features/step_definitions/dokku_installer_cli_steps.rb
88
+ - features/support/env.rb
89
+ - lib/dokku_installer_cli.rb
90
+ - lib/dokku_installer_cli/version.rb
91
+ - test/tc_something.rb
92
+ homepage: https://github.com/brianpattison/dokku-installer-cli
93
+ licenses:
94
+ - MIT
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubyforge_project:
112
+ rubygems_version: 2.2.2
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: Command line tool for Dokku Installer
116
+ test_files:
117
+ - features/dokku_installer_cli.feature
118
+ - features/step_definitions/dokku_installer_cli_steps.rb
119
+ - features/support/env.rb
120
+ - test/tc_something.rb