dip 6.0.0 → 7.1.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 +34 -35
- data/exe/dip +6 -6
- data/lib/dip.rb +1 -1
- data/lib/dip/cli.rb +29 -24
- data/lib/dip/cli/console.rb +7 -7
- data/lib/dip/cli/dns.rb +31 -31
- data/lib/dip/cli/nginx.rb +25 -25
- data/lib/dip/cli/ssh.rb +25 -22
- data/lib/dip/command.rb +29 -18
- data/lib/dip/commands/compose.rb +11 -10
- data/lib/dip/commands/console.rb +5 -5
- data/lib/dip/commands/dns.rb +12 -12
- data/lib/dip/commands/list.rb +3 -3
- data/lib/dip/commands/nginx.rb +8 -8
- data/lib/dip/commands/provision.rb +2 -2
- data/lib/dip/commands/run.rb +40 -18
- data/lib/dip/commands/ssh.rb +19 -11
- data/lib/dip/config.rb +18 -9
- data/lib/dip/environment.rb +6 -6
- data/lib/dip/ext/hash.rb +1 -1
- data/lib/dip/interaction_tree.rb +4 -16
- data/lib/dip/version.rb +1 -1
- metadata +38 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e42a461aef491ba31638884320252a28f891416510128a0dee140d8c8b3e8a8
|
4
|
+
data.tar.gz: 836d775a9c88f2df8bc807207710f84b39502b4e1f7e19747cf4f231fb3e7b06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88e61d6a5dfe78dd7dba7f1993ea8260f991fabc1921c144157dd4778bf1ccd4839472436327548d12b29222437bcfc08588f25a94e724fc74701b3a81c2d904
|
7
|
+
data.tar.gz: 564e4cc1f1fe2aa824b9ca061a0e7a446074faeadb24ee620192cc53bcb3f7fab0cdf3d4849611ee963f7a0d3700089bc1932911096f740212165420b45e452d
|
data/README.md
CHANGED
@@ -16,9 +16,11 @@ A command-line utility that gives the "native" interaction with applications con
|
|
16
16
|
## Presentations and examples
|
17
17
|
|
18
18
|
- [Local development with Docker containers](https://slides.com/bibendi/dip)
|
19
|
-
- Dockerized Ruby on Rails applications: [one](https://github.com/bibendi/dip-example-rails), [
|
19
|
+
- Dockerized Ruby on Rails applications: [one](https://github.com/lewagon/rails-k8s-demo), [two](https://github.com/bibendi/dip-example-rails), [three](https://github.com/evilmartians/evil_chat)
|
20
20
|
- Dockerized Node.js application: [one](https://github.com/bibendi/twinkle.js), [two](https://github.com/bibendi/yt-graphql-react-event-booking-api)
|
21
21
|
- [Dockerized Ruby gem](https://github.com/bibendi/schked)
|
22
|
+
- [Dockerizing Ruby and Rails development](https://evilmartians.com/chronicles/ruby-on-whales-docker-for-ruby-rails-development)
|
23
|
+
- [Reusable development containers with Docker Compose and Dip](https://evilmartians.com/chronicles/reusable-development-containers-with-docker-compose-and-dip)
|
22
24
|
|
23
25
|
[](https://asciinema.org/a/210236)
|
24
26
|
|
@@ -36,6 +38,7 @@ After that we can type commands without `dip` prefix. For example:
|
|
36
38
|
<run-command> *any-args
|
37
39
|
compose *any-compose-arg
|
38
40
|
up <service>
|
41
|
+
build
|
39
42
|
down
|
40
43
|
provision
|
41
44
|
```
|
@@ -53,41 +56,11 @@ After that, it will be automatically applied when you open your preferred termin
|
|
53
56
|
|
54
57
|
## Installation
|
55
58
|
|
56
|
-
You have many ways.
|
57
|
-
|
58
|
-
### Homebrew
|
59
|
-
|
60
|
-
|
61
|
-
You can use [Homebrew](https://brew.sh) on macOS (or [Linux](https://docs.brew.sh/Homebrew-on-Linux)).
|
62
|
-
|
63
|
-
Today Homebrew tap for DIP is located at https://github.com/bibendi/homebrew-dip
|
64
|
-
|
65
|
-
```sh
|
66
|
-
brew tap bibendi/dip
|
67
|
-
brew install dip
|
68
|
-
```
|
69
|
-
|
70
|
-
### Ruby Gem
|
71
|
-
|
72
59
|
```sh
|
73
60
|
gem install dip
|
74
61
|
```
|
75
62
|
|
76
|
-
|
77
|
-
|
78
|
-
If you don't have installed Ruby, then you could copy a precompiled binary to your system.
|
79
|
-
It can be found at [releases page](https://github.com/bibendi/dip/releases)
|
80
|
-
or type bellow into your terminal:
|
81
|
-
|
82
|
-
```sh
|
83
|
-
curl -L https://github.com/bibendi/dip/releases/download/v6.0.0/dip-`uname -s`-`uname -m` > /usr/local/bin/dip
|
84
|
-
chmod +x /usr/local/bin/dip
|
85
|
-
```
|
86
|
-
|
87
|
-
## Docker installation
|
88
|
-
|
89
|
-
- [Ubuntu](docs/docker-ubuntu-install.md)
|
90
|
-
- [Mac OS](docs/docker-for-mac-install.md)
|
63
|
+
The compiled binary is no more provided since version 7, because of new version of [Ruby Packer](https://github.com/pmq20/ruby-packer) not released for a long time with recent Ruby version. Also there was a lot of work to prepare each release of Dip for MacOS version.
|
91
64
|
|
92
65
|
## Usage
|
93
66
|
|
@@ -108,7 +81,7 @@ Also, you can check out examples at the top.
|
|
108
81
|
|
109
82
|
```yml
|
110
83
|
# Required minimum dip version
|
111
|
-
version: '
|
84
|
+
version: '7.1'
|
112
85
|
|
113
86
|
environment:
|
114
87
|
COMPOSE_EXT: development
|
@@ -121,7 +94,7 @@ compose:
|
|
121
94
|
project_name: bear
|
122
95
|
|
123
96
|
interaction:
|
124
|
-
|
97
|
+
shell:
|
125
98
|
description: Open the Bash shell in app's container
|
126
99
|
service: app
|
127
100
|
command: bash
|
@@ -169,8 +142,19 @@ interaction:
|
|
169
142
|
default_args: db_dev
|
170
143
|
command: psql -h pg -U postgres
|
171
144
|
|
145
|
+
setup_key:
|
146
|
+
description: Copy key
|
147
|
+
service: app
|
148
|
+
command: cp `pwd`/config/key.pem /root/keys/
|
149
|
+
shell: false # you can disable shell interpolations on the host machine and send the command as is
|
150
|
+
|
151
|
+
clean_cache:
|
152
|
+
description: Delete cache files on the host machine
|
153
|
+
command: rm -rf $(pwd)/tmp/cache/*
|
154
|
+
|
172
155
|
provision:
|
173
156
|
- dip compose down --volumes
|
157
|
+
- dip clean_cache
|
174
158
|
- dip compose up -d pg redis
|
175
159
|
- dip bash -c ./bin/setup
|
176
160
|
```
|
@@ -237,7 +221,7 @@ dip VERSION=12352452 rake db:rollback
|
|
237
221
|
Use options `-p, --publish=[]` if you need to additionally publish a container's port(s) to the host unless this behaviour is not configured at dip.yml:
|
238
222
|
|
239
223
|
```sh
|
240
|
-
dip run -p 3000:3000 bundle exec rackup config.ru
|
224
|
+
dip run -p 3000:3000 bundle exec rackup config.ru
|
241
225
|
```
|
242
226
|
|
243
227
|
### dip ls
|
@@ -292,6 +276,21 @@ volumes:
|
|
292
276
|
name: ssh_data
|
293
277
|
```
|
294
278
|
|
279
|
+
if you want to use non-root user you can specify UID like so:
|
280
|
+
|
281
|
+
```
|
282
|
+
dip ssh up -u 1000
|
283
|
+
```
|
284
|
+
|
285
|
+
This especially helpful if you have something like this in your docker-compose.yml:
|
286
|
+
|
287
|
+
```
|
288
|
+
services:
|
289
|
+
web:
|
290
|
+
user: "1000:1000"
|
291
|
+
|
292
|
+
```
|
293
|
+
|
295
294
|
### dip nginx
|
296
295
|
|
297
296
|
Runs Nginx server container based on [bibendi/nginx-proxy](https://github.com/bibendi/nginx-proxy) image. An application's docker-compose.yml should contain environment variable `VIRTUAL_HOST` and `VIRTUAL_PATH` and connects to external network `frontend`.
|
data/exe/dip
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
lib_path = File.expand_path(
|
4
|
+
lib_path = File.expand_path("../lib", __dir__)
|
5
5
|
$LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)
|
6
6
|
|
7
7
|
begin
|
8
|
-
require
|
8
|
+
require "pry-byebug" if ENV["DIP_ENV"] == "debug"
|
9
9
|
rescue LoadError
|
10
10
|
# do nothing
|
11
11
|
end
|
12
12
|
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
13
|
+
require "dip"
|
14
|
+
require "dip/cli"
|
15
|
+
require "dip/run_vars"
|
16
16
|
|
17
|
-
Signal.trap(
|
17
|
+
Signal.trap("INT") do
|
18
18
|
warn("\n#{caller.join("\n")}: interrupted")
|
19
19
|
exit(1)
|
20
20
|
end
|
data/lib/dip.rb
CHANGED
data/lib/dip/cli.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "thor"
|
4
|
+
require "dip/run_vars"
|
5
5
|
|
6
6
|
module Dip
|
7
7
|
class CLI < Thor
|
@@ -34,25 +34,30 @@ module Dip
|
|
34
34
|
|
35
35
|
stop_on_unknown_option! :run
|
36
36
|
|
37
|
-
desc
|
37
|
+
desc "version", "dip version"
|
38
38
|
def version
|
39
|
-
require_relative
|
39
|
+
require_relative "version"
|
40
40
|
puts Dip::VERSION
|
41
41
|
end
|
42
|
-
map %w
|
42
|
+
map %w[--version -v] => :version
|
43
43
|
|
44
|
-
desc
|
44
|
+
desc "ls", "List available run commands"
|
45
45
|
def ls
|
46
|
-
require_relative
|
46
|
+
require_relative "commands/list"
|
47
47
|
Dip::Commands::List.new.execute
|
48
48
|
end
|
49
49
|
|
50
|
-
desc
|
50
|
+
desc "compose CMD [OPTIONS]", "Run docker-compose commands"
|
51
51
|
def compose(*argv)
|
52
|
-
require_relative
|
52
|
+
require_relative "commands/compose"
|
53
53
|
Dip::Commands::Compose.new(*argv).execute
|
54
54
|
end
|
55
55
|
|
56
|
+
desc "build [OPTIONS] SERVICE", "Run `docker-compose build` command"
|
57
|
+
def build(*argv)
|
58
|
+
compose("build", *argv)
|
59
|
+
end
|
60
|
+
|
56
61
|
desc "up [OPTIONS] SERVICE", "Run `docker-compose up` command"
|
57
62
|
def up(*argv)
|
58
63
|
compose("up", *argv)
|
@@ -63,50 +68,50 @@ module Dip
|
|
63
68
|
compose("stop", *argv)
|
64
69
|
end
|
65
70
|
|
66
|
-
desc "down
|
71
|
+
desc "down [OPTIONS]", "Run `docker-compose down` command"
|
67
72
|
def down(*argv)
|
68
73
|
compose("down", *argv)
|
69
74
|
end
|
70
75
|
|
71
|
-
desc
|
72
|
-
method_option :publish, aliases:
|
76
|
+
desc "run [OPTIONS] CMD [ARGS]", "Run configured command in a docker-compose service. `run` prefix may be omitted"
|
77
|
+
method_option :publish, aliases: "-p", type: :string, repeatable: true,
|
73
78
|
desc: "Publish a container's port(s) to the host"
|
74
|
-
method_option :help, aliases:
|
79
|
+
method_option :help, aliases: "-h", type: :boolean, desc: "Display usage information"
|
75
80
|
def run(*argv)
|
76
81
|
if argv.empty? || options[:help]
|
77
|
-
invoke :help, [
|
82
|
+
invoke :help, ["run"]
|
78
83
|
else
|
79
|
-
require_relative
|
84
|
+
require_relative "commands/run"
|
80
85
|
Dip::Commands::Run.new(*argv, publish: options[:publish]).execute
|
81
86
|
end
|
82
87
|
end
|
83
88
|
|
84
89
|
desc "provision", "Execute commands within provision section"
|
85
|
-
method_option :help, aliases:
|
86
|
-
desc:
|
90
|
+
method_option :help, aliases: "-h", type: :boolean,
|
91
|
+
desc: "Display usage information"
|
87
92
|
def provision
|
88
93
|
if options[:help]
|
89
|
-
invoke :help, [
|
94
|
+
invoke :help, ["provision"]
|
90
95
|
else
|
91
|
-
require_relative
|
96
|
+
require_relative "commands/provision"
|
92
97
|
Dip::Commands::Provision.new.execute
|
93
98
|
end
|
94
99
|
end
|
95
100
|
|
96
|
-
require_relative
|
101
|
+
require_relative "cli/ssh"
|
97
102
|
desc "ssh", "ssh-agent container commands"
|
98
103
|
subcommand :ssh, Dip::CLI::SSH
|
99
104
|
|
100
|
-
require_relative
|
105
|
+
require_relative "cli/dns"
|
101
106
|
desc "dns", "DNS server for automatic docker container discovery"
|
102
107
|
subcommand :dns, Dip::CLI::DNS
|
103
108
|
|
104
|
-
require_relative
|
109
|
+
require_relative "cli/nginx"
|
105
110
|
desc "nginx", "Nginx reverse proxy server"
|
106
111
|
subcommand :nginx, Dip::CLI::Nginx
|
107
112
|
|
108
|
-
require_relative
|
109
|
-
desc "console", "Integrate Dip commands into shell (only ZSH and Bash
|
113
|
+
require_relative "cli/console"
|
114
|
+
desc "console", "Integrate Dip commands into shell (only ZSH and Bash are supported)"
|
110
115
|
subcommand :console, Dip::CLI::Console
|
111
116
|
end
|
112
117
|
end
|
data/lib/dip/cli/console.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "thor"
|
4
4
|
require_relative "./base"
|
5
5
|
require_relative "../commands/console"
|
6
6
|
|
@@ -8,11 +8,11 @@ module Dip
|
|
8
8
|
class CLI
|
9
9
|
class Console < Base
|
10
10
|
desc "start", "Integrate Dip into current shell"
|
11
|
-
method_option :help, aliases:
|
12
|
-
desc:
|
11
|
+
method_option :help, aliases: "-h", type: :boolean,
|
12
|
+
desc: "Display usage information"
|
13
13
|
def start
|
14
14
|
if options[:help]
|
15
|
-
invoke :help, [
|
15
|
+
invoke :help, ["start"]
|
16
16
|
else
|
17
17
|
Dip::Commands::Console::Start.new.execute
|
18
18
|
end
|
@@ -21,11 +21,11 @@ module Dip
|
|
21
21
|
default_task :start
|
22
22
|
|
23
23
|
desc "inject", "Inject aliases"
|
24
|
-
method_option :help, aliases:
|
25
|
-
desc:
|
24
|
+
method_option :help, aliases: "-h", type: :boolean,
|
25
|
+
desc: "Display usage information"
|
26
26
|
def inject
|
27
27
|
if options[:help]
|
28
|
-
invoke :help, [
|
28
|
+
invoke :help, ["inject"]
|
29
29
|
else
|
30
30
|
Dip::Commands::Console::Inject.new.execute
|
31
31
|
end
|
data/lib/dip/cli/dns.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "thor"
|
4
4
|
require_relative "./base"
|
5
5
|
require_relative "../commands/dns"
|
6
6
|
|
@@ -9,23 +9,23 @@ module Dip
|
|
9
9
|
# See more https://github.com/aacebedo/dnsdock
|
10
10
|
class DNS < Base
|
11
11
|
desc "up", "Run dnsdock container"
|
12
|
-
method_option :help, aliases:
|
13
|
-
desc:
|
14
|
-
method_option :name, aliases:
|
15
|
-
desc:
|
16
|
-
method_option :socket, aliases:
|
17
|
-
desc:
|
18
|
-
method_option :net, aliases:
|
19
|
-
desc:
|
20
|
-
method_option :publish, aliases:
|
21
|
-
desc:
|
22
|
-
method_option :image, aliases:
|
23
|
-
desc:
|
24
|
-
method_option :domain, aliases:
|
25
|
-
desc:
|
12
|
+
method_option :help, aliases: "-h", type: :boolean,
|
13
|
+
desc: "Display usage information"
|
14
|
+
method_option :name, aliases: "-n", type: :string, default: "dnsdock",
|
15
|
+
desc: "Container name"
|
16
|
+
method_option :socket, aliases: "-s", type: :string, default: "/var/run/docker.sock",
|
17
|
+
desc: "Path to docker socket"
|
18
|
+
method_option :net, aliases: "-t", type: :string, default: "frontend",
|
19
|
+
desc: "Container network name"
|
20
|
+
method_option :publish, aliases: "-p", type: :string, default: "53/udp",
|
21
|
+
desc: "Container port"
|
22
|
+
method_option :image, aliases: "-i", type: :string, default: "aacebedo/dnsdock:latest-amd64",
|
23
|
+
desc: "Docker image name"
|
24
|
+
method_option :domain, aliases: "-d", type: :string, default: "docker",
|
25
|
+
desc: "Top level domain"
|
26
26
|
def up
|
27
27
|
if options[:help]
|
28
|
-
invoke :help, [
|
28
|
+
invoke :help, ["up"]
|
29
29
|
else
|
30
30
|
Dip::Commands::DNS::Up.new(
|
31
31
|
name: options.fetch(:name),
|
@@ -39,13 +39,13 @@ module Dip
|
|
39
39
|
end
|
40
40
|
|
41
41
|
desc "down", "Stop dnsdock container"
|
42
|
-
method_option :help, aliases:
|
43
|
-
desc:
|
44
|
-
method_option :name, aliases:
|
45
|
-
desc:
|
42
|
+
method_option :help, aliases: "-h", type: :boolean,
|
43
|
+
desc: "Display usage information"
|
44
|
+
method_option :name, aliases: "-n", type: :string, default: "dnsdock",
|
45
|
+
desc: "Container name"
|
46
46
|
def down
|
47
47
|
if options[:help]
|
48
|
-
invoke :help, [
|
48
|
+
invoke :help, ["down"]
|
49
49
|
else
|
50
50
|
Dip::Commands::DNS::Down.new(
|
51
51
|
name: options.fetch(:name)
|
@@ -54,11 +54,11 @@ module Dip
|
|
54
54
|
end
|
55
55
|
|
56
56
|
desc "restart", "Stop and start dnsdock container"
|
57
|
-
method_option :help, aliases:
|
58
|
-
desc:
|
57
|
+
method_option :help, aliases: "-h", type: :boolean,
|
58
|
+
desc: "Display usage information"
|
59
59
|
def restart(*args)
|
60
60
|
if options[:help]
|
61
|
-
invoke :help, [
|
61
|
+
invoke :help, ["restart"]
|
62
62
|
else
|
63
63
|
Dip::CLI::DNS.start(["down"] + args)
|
64
64
|
sleep 1
|
@@ -67,15 +67,15 @@ module Dip
|
|
67
67
|
end
|
68
68
|
|
69
69
|
desc "ip", "Get ip address of dnsdock container"
|
70
|
-
method_option :help, aliases:
|
71
|
-
desc:
|
72
|
-
method_option :name, aliases:
|
73
|
-
desc:
|
74
|
-
method_option :net, aliases:
|
75
|
-
desc:
|
70
|
+
method_option :help, aliases: "-h", type: :boolean,
|
71
|
+
desc: "Display usage information"
|
72
|
+
method_option :name, aliases: "-n", type: :string, default: "dnsdock",
|
73
|
+
desc: "Container name"
|
74
|
+
method_option :net, aliases: "-t", type: :string, default: "frontend",
|
75
|
+
desc: "Container network name"
|
76
76
|
def ip
|
77
77
|
if options[:help]
|
78
|
-
invoke :help, [
|
78
|
+
invoke :help, ["status"]
|
79
79
|
else
|
80
80
|
Dip::Commands::DNS::IP.new(
|
81
81
|
name: options.fetch(:name),
|
data/lib/dip/cli/nginx.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "thor"
|
4
4
|
require_relative "./base"
|
5
5
|
require_relative "../commands/nginx"
|
6
6
|
|
@@ -9,24 +9,24 @@ module Dip
|
|
9
9
|
# See more https://github.com/bibendi/nginx-proxy
|
10
10
|
class Nginx < Base
|
11
11
|
desc "up", "Run nginx container"
|
12
|
-
method_option :help, aliases:
|
13
|
-
desc:
|
14
|
-
method_option :name, aliases:
|
15
|
-
desc:
|
16
|
-
method_option :socket, aliases:
|
17
|
-
desc:
|
18
|
-
method_option :net, aliases:
|
19
|
-
desc:
|
20
|
-
method_option :publish, aliases:
|
21
|
-
desc:
|
22
|
-
method_option :image, aliases:
|
23
|
-
desc:
|
24
|
-
method_option :domain, aliases:
|
25
|
-
desc:
|
26
|
-
method_option :certs, aliases:
|
12
|
+
method_option :help, aliases: "-h", type: :boolean,
|
13
|
+
desc: "Display usage information"
|
14
|
+
method_option :name, aliases: "-n", type: :string, default: "nginx",
|
15
|
+
desc: "Container name"
|
16
|
+
method_option :socket, aliases: "-s", type: :string, default: "/var/run/docker.sock",
|
17
|
+
desc: "Path to docker socket"
|
18
|
+
method_option :net, aliases: "-t", type: :string, default: "frontend",
|
19
|
+
desc: "Container network name"
|
20
|
+
method_option :publish, aliases: "-p", type: :array, default: ["80:80"],
|
21
|
+
desc: "Container port(s). For more than one port, separate them by a space"
|
22
|
+
method_option :image, aliases: "-i", type: :string, default: "bibendi/nginx-proxy:latest",
|
23
|
+
desc: "Docker image name"
|
24
|
+
method_option :domain, aliases: "-d", type: :string, default: "docker",
|
25
|
+
desc: "Top level domain"
|
26
|
+
method_option :certs, aliases: "-c", type: :string, desc: "Path to ssl certificates"
|
27
27
|
def up
|
28
28
|
if options[:help]
|
29
|
-
invoke :help, [
|
29
|
+
invoke :help, ["up"]
|
30
30
|
else
|
31
31
|
Dip::Commands::Nginx::Up.new(
|
32
32
|
name: options.fetch(:name),
|
@@ -41,13 +41,13 @@ module Dip
|
|
41
41
|
end
|
42
42
|
|
43
43
|
desc "down", "Stop nginx container"
|
44
|
-
method_option :help, aliases:
|
45
|
-
desc:
|
46
|
-
method_option :name, aliases:
|
47
|
-
desc:
|
44
|
+
method_option :help, aliases: "-h", type: :boolean,
|
45
|
+
desc: "Display usage information"
|
46
|
+
method_option :name, aliases: "-n", type: :string, default: "nginx",
|
47
|
+
desc: "Container name"
|
48
48
|
def down
|
49
49
|
if options[:help]
|
50
|
-
invoke :help, [
|
50
|
+
invoke :help, ["down"]
|
51
51
|
else
|
52
52
|
Dip::Commands::Nginx::Down.new(
|
53
53
|
name: options.fetch(:name)
|
@@ -56,11 +56,11 @@ module Dip
|
|
56
56
|
end
|
57
57
|
|
58
58
|
desc "restart", "Stop and start nginx container"
|
59
|
-
method_option :help, aliases:
|
60
|
-
desc:
|
59
|
+
method_option :help, aliases: "-h", type: :boolean,
|
60
|
+
desc: "Display usage information"
|
61
61
|
def restart(*args)
|
62
62
|
if options[:help]
|
63
|
-
invoke :help, [
|
63
|
+
invoke :help, ["restart"]
|
64
64
|
else
|
65
65
|
Dip::CLI::Nginx.start(["down"] + args)
|
66
66
|
sleep 1
|