appd 0.2.3 → 0.3.0
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 +4 -4
- data/README.md +1 -0
- data/exe/appd +8 -3
- data/lib/appd/app.rb +8 -4
- data/lib/appd/cli.rb +7 -2
- data/lib/appd/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df84a9eb13ce4d5d509322d6fc8f002a912294bd
|
4
|
+
data.tar.gz: cb406b47a4463c1edfbeaa1d26e3d2f376e6d34a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab2f125e1a4391dcbbe3ddb157b2ee8d7df7dc926a0b852252073e8709d483d15e3d3c2e2a2cb271301150c8e1c723afa53e128126aefed240293d0934cfb701
|
7
|
+
data.tar.gz: c31b348262f5b2f5c2e8823304ca7e1cdd7238f8a434321e9590e733f017717aa0a8908065b378f9378e0a2168833c628b77b74b6504d1bdfc2d6e6ce56fc5dc
|
data/README.md
CHANGED
data/exe/appd
CHANGED
@@ -6,9 +6,14 @@ Signal.trap("INT") { exit 1 }
|
|
6
6
|
require "appd"
|
7
7
|
require "appd/cli"
|
8
8
|
|
9
|
-
if ARGV[0] != "help" &&
|
10
|
-
|
11
|
-
|
9
|
+
if ARGV[0] != "help" && ARGV[0] != "select" && app = ARGV.shift
|
10
|
+
if app == "."
|
11
|
+
ARGV << "--app-path"
|
12
|
+
ARGV << Dir.pwd
|
13
|
+
else
|
14
|
+
ARGV << "--app"
|
15
|
+
ARGV << app
|
16
|
+
end
|
12
17
|
end
|
13
18
|
|
14
19
|
Appd::CLI.start(ARGV, debug: true)
|
data/lib/appd/app.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Appd
|
2
2
|
class App
|
3
|
-
attr_reader :
|
3
|
+
attr_reader :options
|
4
4
|
|
5
|
-
def initialize(
|
6
|
-
@
|
5
|
+
def initialize(options)
|
6
|
+
@options = options
|
7
7
|
end
|
8
8
|
|
9
9
|
def ps
|
@@ -32,8 +32,12 @@ module Appd
|
|
32
32
|
|
33
33
|
private
|
34
34
|
|
35
|
+
def app_path
|
36
|
+
options.app_path || "#{ENV["APP_PATH"]}/#{options.app}"
|
37
|
+
end
|
38
|
+
|
35
39
|
def docker_compose(command)
|
36
|
-
Appd.exec "direnv exec
|
40
|
+
Appd.exec "direnv exec #{app_path} docker-compose -f #{app_path}/docker-compose.yml #{command}"
|
37
41
|
end
|
38
42
|
end
|
39
43
|
end
|
data/lib/appd/cli.rb
CHANGED
@@ -2,7 +2,11 @@ require "thor"
|
|
2
2
|
|
3
3
|
module Appd
|
4
4
|
class CLI < Thor
|
5
|
-
class_option :
|
5
|
+
class_option :app_path, type: :string, hide: true
|
6
|
+
class_option :app, type: :string, hide: true, required: ARGV.count > 0 &&
|
7
|
+
ARGV[0] != 'help' &&
|
8
|
+
ARGV[0] != "select" &&
|
9
|
+
ARGV[0] != "."
|
6
10
|
|
7
11
|
default_task :help
|
8
12
|
|
@@ -13,6 +17,7 @@ module Appd
|
|
13
17
|
puts "Commands:"
|
14
18
|
self.class.commands.each { |_, command| printf "%-30s %s\n", " #{command.usage} ", "# #{command.description}" }
|
15
19
|
puts "\nNote: appd looks for apps in the $APP_PATH directory."
|
20
|
+
puts " APPNAME can be . for current app."
|
16
21
|
end
|
17
22
|
|
18
23
|
desc "ps", "List containers"
|
@@ -49,7 +54,7 @@ module Appd
|
|
49
54
|
|
50
55
|
no_tasks do
|
51
56
|
def app
|
52
|
-
Appd::App.new(options
|
57
|
+
Appd::App.new(options)
|
53
58
|
end
|
54
59
|
end
|
55
60
|
end
|
data/lib/appd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Morgan Showman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.5.1
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Docker compose wrapper for managing containers.
|