-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.go
204 lines (198 loc) · 5.84 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
package main
import (
"github.com/faradey/madock/src/controller/general/bash"
"github.com/faradey/madock/src/controller/general/clean_cache"
"github.com/faradey/madock/src/controller/general/cli"
"github.com/faradey/madock/src/controller/general/composer"
"github.com/faradey/madock/src/controller/general/config"
"github.com/faradey/madock/src/controller/general/cron"
"github.com/faradey/madock/src/controller/general/db/export"
"github.com/faradey/madock/src/controller/general/db/import"
info2 "github.com/faradey/madock/src/controller/general/db/info"
"github.com/faradey/madock/src/controller/general/debug"
"github.com/faradey/madock/src/controller/general/help"
"github.com/faradey/madock/src/controller/general/info"
"github.com/faradey/madock/src/controller/general/install"
"github.com/faradey/madock/src/controller/general/isnotdefine"
"github.com/faradey/madock/src/controller/general/logs"
"github.com/faradey/madock/src/controller/general/node"
"github.com/faradey/madock/src/controller/general/open"
"github.com/faradey/madock/src/controller/general/patch"
"github.com/faradey/madock/src/controller/general/project/clone"
"github.com/faradey/madock/src/controller/general/project/remove"
"github.com/faradey/madock/src/controller/general/proxy"
"github.com/faradey/madock/src/controller/general/prune"
"github.com/faradey/madock/src/controller/general/rebuild"
db2 "github.com/faradey/madock/src/controller/general/remote_sync/db"
"github.com/faradey/madock/src/controller/general/remote_sync/file"
"github.com/faradey/madock/src/controller/general/remote_sync/media"
"github.com/faradey/madock/src/controller/general/restart"
"github.com/faradey/madock/src/controller/general/scope/add"
listScope "github.com/faradey/madock/src/controller/general/scope/list"
"github.com/faradey/madock/src/controller/general/scope/set"
"github.com/faradey/madock/src/controller/general/service/disable"
"github.com/faradey/madock/src/controller/general/service/enable"
"github.com/faradey/madock/src/controller/general/service/list"
"github.com/faradey/madock/src/controller/general/setup"
"github.com/faradey/madock/src/controller/general/setup/env"
"github.com/faradey/madock/src/controller/general/snapshot/create"
"github.com/faradey/madock/src/controller/general/snapshot/restore"
"github.com/faradey/madock/src/controller/general/ssl"
"github.com/faradey/madock/src/controller/general/start"
"github.com/faradey/madock/src/controller/general/status"
"github.com/faradey/madock/src/controller/general/stop"
"github.com/faradey/madock/src/controller/magento"
"github.com/faradey/madock/src/controller/magento/cloud"
"github.com/faradey/madock/src/controller/magento/mftf"
"github.com/faradey/madock/src/controller/magento/n98"
"github.com/faradey/madock/src/controller/pwa"
"github.com/faradey/madock/src/controller/shopify"
"github.com/faradey/madock/src/controller/shopify/frontend"
"github.com/faradey/madock/src/controller/shopify/web"
"github.com/faradey/madock/src/controller/shopware"
"github.com/faradey/madock/src/helper/compress"
"github.com/faradey/madock/src/migration"
"log"
"os"
"strings"
)
var appVersion string = "2.4.3"
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile | log.Lmicroseconds)
migration.Apply(appVersion)
if len(os.Args) <= 1 {
help.Execute()
return
}
command := strings.ToLower(os.Args[1])
switch command {
case "bash":
bash.Execute()
case "c:f":
clean_cache.Execute()
case "magento-cloud", "cloud":
cloud.Execute()
case "cli":
cli.Execute()
case "composer":
composer.Execute()
case "compress":
compress.Zip()
case "config:cache:clean", "c:c:c":
config.CacheClean()
case "config:list":
config.ShowEnv()
case "config:set":
config.SetEnvOption()
case "cron:enable":
cron.Enable()
case "cron:disable":
cron.Disable()
case "db:import":
_import.Import()
case "db:export":
export.Export()
case "db:info":
info2.Info()
case "debug:enable":
debug.Enable()
case "debug:disable":
debug.Disable()
case "debug:profile:enable":
debug.ProfileEnable()
case "debug:profile:disable":
debug.ProfileDisable()
case "info":
info.Info()
case "install":
install.Execute()
case "help":
help.Execute()
case "logs":
logs.Execute()
case "magento", "m":
magento.Execute()
case "mftf":
mftf.Execute()
case "mftf:init":
mftf.Init()
case "n98":
n98.Execute()
case "node":
node.Execute()
case "open":
open.Execute()
case "patch:create":
patch.Execute()
case "project:clone":
clone.Execute()
case "project:remove":
remove.Execute()
case "proxy:start":
proxy.Execute("start")
case "proxy:stop":
proxy.Execute("stop")
case "proxy:restart":
proxy.Execute("restart")
case "proxy:rebuild":
proxy.Execute("rebuild")
case "proxy:prune":
proxy.Execute("prune")
case "prune":
prune.Execute()
case "rebuild":
rebuild.Execute()
case "remote:sync:db":
db2.Execute()
case "remote:sync:media":
media.Execute()
case "remote:sync:file":
file.Execute()
case "restart":
restart.Execute()
case "pwa":
pwa.Execute()
case "scope:add":
add.Execute()
case "scope:list":
listScope.Execute()
case "scope:set":
set.Execute()
case "service:list":
list.Execute()
case "service:enable":
enable.Execute()
case "service:disable":
disable.Execute()
case "setup":
setup.Execute()
case "setup:env":
env.Execute()
case "shopify", "sy":
shopify.Execute()
case "shopify:web", "sy:w":
web.Execute()
case "shopify:web:frontend", "sy:w:f":
frontend.Execute()
case "shopware", "sw":
shopware.Execute()
case "snapshot:create":
create.Execute()
case "snapshot:restore":
restore.Execute()
case "ssl:rebuild":
ssl.Execute()
case "start":
start.Execute()
case "status":
status.Execute()
case "stop":
stop.Execute()
case "uncompress":
compress.Unzip()
default:
isnotdefine.Execute(command)
}
}
//TODO check rabbitMQ in browser
//TODO check redis in browser