ff62d39f023fbe2872078ce82ea9704b1bf09ea6
- Author
- Marc Cornellà <marc@mcornella.com>
- Committer
- Marc Cornellà <marc@mcornella.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/docker-machine/README.md b/plugins/docker-machine/README.md
2deleted file mode 100644
3index 308a6cfdb608c811b65d7a6f57516d67d018518a..0000000000000000000000000000000000000000
4--- a/plugins/docker-machine/README.md
5+++ /dev/null
6@@ -1,19 +0,0 @@
7-# docker-machine plugin for oh my zsh
8-
9-### Usage
10-
11-#### docker-vm
12-Will create a docker-machine with the name "dev" (required only once)
13-To create a second machine call "docker-vm foobar" or pass any other name
14-
15-#### docker-up
16-This will start your "dev" docker-machine (if necessary) and set it as the active one
17-To start a named machine use "docker-up foobar"
18-
19-#### docker-switch dev
20-Use this to activate a running docker-machine (or to switch between multiple machines)
21-You need to call either this or docker-up when opening a new terminal
22-
23-#### docker-stop
24-This will stop your "dev" docker-machine
25-To stop a named machine use "docker-stop foobar"
26diff --git a/plugins/docker-machine/_docker-machine b/plugins/docker-machine/_docker-machine
27deleted file mode 100644
28index 17bcd3598b82d4e61056a9299a76bbd2669e2916..0000000000000000000000000000000000000000
29--- a/plugins/docker-machine/_docker-machine
30+++ /dev/null
31@@ -1,359 +0,0 @@
32-#compdef docker-machine
33-# Description
34-# -----------
35-# zsh completion for docker-machine
36-# https://github.com/leonhartX/docker-machine-zsh-completion
37-# -------------------------------------------------------------------------
38-# Version
39-# -------
40-# 0.1.1
41-# -------------------------------------------------------------------------
42-# Authors
43-# -------
44-# * Ke Xu <leonhartx.k@gmail.com>
45-# -------------------------------------------------------------------------
46-# Inspiration
47-# -----------
48-# * @sdurrheimer docker-compose-zsh-completion https://github.com/sdurrheimer/docker-compose-zsh-completion
49-# * @ilkka _docker-machine
50-
51-
52-__docker-machine_get_hosts() {
53- [[ $PREFIX = -* ]] && return 1
54- local state
55- declare -a hosts
56- state=$1; shift
57- if [[ $state != all ]]; then
58- hosts=(${(f)"$(_call_program commands docker-machine ls -q --filter state=$state)"})
59- else
60- hosts=(${(f)"$(_call_program commands docker-machine ls -q)"})
61- fi
62- _describe 'host' hosts "$@" && ret=0
63- return ret
64-}
65-
66-__docker-machine_hosts_with_state() {
67- declare -a hosts
68- hosts=(${(f)"$(_call_program commands docker-machine ls -f '{{.Name}}\:{{.DriverName}}\({{.State}}\)\ {{.URL}}')"})
69- _describe 'host' hosts
70-}
71-
72-__docker-machine_hosts_all() {
73- __docker-machine_get_hosts all "$@"
74-}
75-
76-__docker-machine_hosts_running() {
77- __docker-machine_get_hosts Running "$@"
78-}
79-
80-__docker-machine_get_swarm() {
81- declare -a swarms
82- swarms=(${(f)"$(_call_program commands docker-machine ls -f {{.Swarm}} | awk '{print $1}')"})
83- _describe 'swarm' swarms
84-}
85-
86-__docker-machine_hosts_and_files() {
87- _alternative "hosts:host:__docker-machine_hosts_all -qS ':'" 'files:files:_path_files'
88-}
89-
90-__docker-machine_filters() {
91- [[ $PREFIX = -* ]] && return 1
92- integer ret=1
93-
94- if compset -P '*='; then
95- case "${${words[-1]%=*}#*=}" in
96- (driver)
97- _describe -t driver-filter-opts "driver filter" opts_driver && ret=0
98- ;;
99- (swarm)
100- __docker-machine_get_swarm && ret=0
101- ;;
102- (state)
103- opts_state=('Running' 'Paused' 'Saved' 'Stopped' 'Stopping' 'Starting' 'Error')
104- _describe -t state-filter-opts "state filter" opts_state && ret=0
105- ;;
106- (name)
107- __docker-machine_hosts_all && ret=0
108- ;;
109- (label)
110- _message 'label' && ret=0
111- ;;
112- *)
113- _message 'value' && ret=0
114- ;;
115- esac
116- else
117- opts=('driver' 'swarm' 'state' 'name' 'label')
118- _describe -t filter-opts "filter" opts -qS "=" && ret=0
119- fi
120- return ret
121-}
122-
123-__get_swarm_discovery() {
124- declare -a masters services
125- local service
126- services=()
127- masters=($(docker-machine ls -f {{.Swarm}} |grep '(master)' |awk '{print $1}'))
128- for master in $masters; do
129- service=${${${(f)"$(_call_program commands docker-machine inspect -f '{{.HostOptions.SwarmOptions.Discovery}}:{{.Name}}' $master)"}/:/\\:}}
130- services=($services $service)
131diff --git a/plugins/docker-machine/docker-machine.plugin.zsh b/plugins/docker-machine/docker-machine.plugin.zsh
132deleted file mode 100644
133index 235d90ee8ff38c413987a69ec3d22d6685c4bc14..0000000000000000000000000000000000000000
134--- a/plugins/docker-machine/docker-machine.plugin.zsh
135+++ /dev/null
136@@ -1,33 +0,0 @@
137-DEFAULT_MACHINE="default"
138-
139-docker-up() {
140- if [ -z "$1" ]
141- then
142- docker-machine start "${DEFAULT_MACHINE}"
143- eval $(docker-machine env "${DEFAULT_MACHINE}")
144- else
145- docker-machine start $1
146- eval $(docker-machine env $1)
147- fi
148- echo $DOCKER_HOST
149-}
150-docker-stop() {
151- if [ -z "$1" ]
152- then
153- docker-machine stop "${DEFAULT_MACHINE}"
154- else
155- docker-machine stop $1
156- fi
157-}
158-docker-switch() {
159- eval $(docker-machine env $1)
160- echo $DOCKER_HOST
161-}
162-docker-vm() {
163- if [ -z "$1" ]
164- then
165- docker-machine create -d virtualbox --virtualbox-disk-size 20000 --virtualbox-memory 4096 --virtualbox-cpu-count 2 "${DEFAULT_MACHINE}"
166- else
167- docker-machine create -d virtualbox --virtualbox-disk-size 20000 --virtualbox-memory 4096 --virtualbox-cpu-count 2 $1
168- fi
169-}