appd 0.4.4 → 0.5.1
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 +48 -3
- data/lib/appd/app.rb +1 -1
- data/lib/appd/cli.rb +17 -8
- data/lib/appd/version.rb +1 -1
- data/lib/appd.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfde514840abf3ced575c0a6e2f6cb3470150290
|
4
|
+
data.tar.gz: 87e2bdf442b99a9465a0f2a69d64ec051db10698
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fcc059df173e05c84f6ce6a2f1aab340a209377ada1c3a151b9d8f3702b2b0855faa91483cdaa6c2977503d58e7c4de677b34f260ccd01ee942d7d18f54d080
|
7
|
+
data.tar.gz: 149efeb8e3d49db78c5ea70c247254adf435104eaed5a0d335656ad95c292d07eb713c803d565f5673d4282cb5c6ec4a18102c3154d66c6b19d323df316b1c4b
|
data/README.md
CHANGED
@@ -32,7 +32,13 @@ export APP_PATH /path/to/your/apps
|
|
32
32
|
# See help
|
33
33
|
appd help
|
34
34
|
Usage:
|
35
|
-
appd APPNAME command
|
35
|
+
appd APPNAME command [OPTIONS]
|
36
|
+
|
37
|
+
Options:
|
38
|
+
-p # Override $APP_PATH
|
39
|
+
-f # Specify a docker-compose.yml file relative to the app
|
40
|
+
# (defaults to: "docker-compose.yml")
|
41
|
+
-s # Specify a docker server env file
|
36
42
|
|
37
43
|
Commands:
|
38
44
|
help # Show this help
|
@@ -43,8 +49,47 @@ Commands:
|
|
43
49
|
restart SERVICES # Restart services
|
44
50
|
exec SERVICE -c "COMMAND" # Execute a command in a running container
|
45
51
|
|
46
|
-
|
47
|
-
|
52
|
+
Notes: Appd looks for apps in the $APP_PATH directory.
|
53
|
+
APPNAME can be . for current app.
|
54
|
+
```
|
55
|
+
|
56
|
+
## Docker Server ENV Files
|
57
|
+
Docker server env files are stored in `~/.appd/` and these files setup
|
58
|
+
the current environment with the correct environment variables for
|
59
|
+
connecting to docker. You can either specify the variables manually or
|
60
|
+
execute the appropriate docker-machine command.
|
61
|
+
|
62
|
+
### Manual ENV
|
63
|
+
|
64
|
+
Usage:
|
65
|
+
|
66
|
+
```sh
|
67
|
+
appd my-app ps -s manual
|
68
|
+
```
|
69
|
+
|
70
|
+
ENV file:
|
71
|
+
|
72
|
+
```sh
|
73
|
+
# ~/.appd/manual
|
74
|
+
export DOCKER_TLS_VERIFY="1"
|
75
|
+
export DOCKER_HOST="tcp://127.0.0.1:2376"
|
76
|
+
export DOCKER_CERT_PATH="/your/path/to/cert"
|
77
|
+
unset DOCKER_MACHINE_NAME
|
78
|
+
```
|
79
|
+
|
80
|
+
### Docker Machine ENV
|
81
|
+
|
82
|
+
Usage:
|
83
|
+
|
84
|
+
```sh
|
85
|
+
appd my-app ps -s docker-machine
|
86
|
+
```
|
87
|
+
|
88
|
+
ENV file:
|
89
|
+
|
90
|
+
```sh
|
91
|
+
# ~/.appd/docker-machine
|
92
|
+
eval "$(docker-machine env my-docker-machine)"
|
48
93
|
```
|
49
94
|
|
50
95
|
## Development
|
data/lib/appd/app.rb
CHANGED
@@ -37,7 +37,7 @@ module Appd
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def docker_compose(command)
|
40
|
-
Appd.exec "direnv exec #{app_path} docker-compose -f #{app_path}
|
40
|
+
Appd.exec "direnv exec #{app_path} docker-compose -f #{app_path}/#{options.file} #{command}", server: options.server
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
data/lib/appd/cli.rb
CHANGED
@@ -2,21 +2,30 @@ require "thor"
|
|
2
2
|
|
3
3
|
module Appd
|
4
4
|
class CLI < Thor
|
5
|
-
class_option :app_path, type: :string,
|
6
|
-
class_option :app, type: :string, hide: true, required: ARGV.count > 0 &&
|
7
|
-
|
8
|
-
|
5
|
+
class_option :app_path, type: :string, aliases: "-p", desc: "Override $APP_PATH"
|
6
|
+
class_option :app, type: :string, hide: true, aliases: "-a", required: ARGV.count > 0 &&
|
7
|
+
ARGV[0] != 'help' &&
|
8
|
+
ARGV[0] != "."
|
9
|
+
class_option :file, type: :string, aliases: "-f", default: "docker-compose.yml", desc: "Specify a docker-compose.yml file relative to the app"
|
10
|
+
class_option :server, type: :string, aliases: "-s", desc: "Specify a docker server env file"
|
9
11
|
|
10
12
|
default_task :help
|
11
13
|
|
12
14
|
desc "help", "Show this help"
|
13
15
|
def help
|
14
16
|
puts "Usage:"
|
15
|
-
puts " appd APPNAME command\n\n"
|
16
|
-
puts "
|
17
|
+
puts " appd APPNAME command [OPTIONS]\n\n"
|
18
|
+
puts "Options:"
|
19
|
+
self.class.class_options.each do |_, option|
|
20
|
+
if !option.hide
|
21
|
+
printf "%-30s %s\n", " #{option.aliases.join(", ")} ", "# #{option.description}"
|
22
|
+
printf "%-30s %s\n", "", "# (defaults to: \"#{option.default}\")" if option.default
|
23
|
+
end
|
24
|
+
end
|
25
|
+
puts "\nCommands:"
|
17
26
|
self.class.commands.each { |_, command| printf "%-30s %s\n", " #{command.usage} ", "# #{command.description}" }
|
18
|
-
puts "\
|
19
|
-
puts "
|
27
|
+
puts "\nNotes: Appd looks for apps in the $APP_PATH directory."
|
28
|
+
puts " APPNAME can be . for current app."
|
20
29
|
end
|
21
30
|
|
22
31
|
desc "ps", "List containers"
|
data/lib/appd/version.rb
CHANGED
data/lib/appd.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.5.1
|
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-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|