-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker_compose.lua
More file actions
80 lines (75 loc) · 1.52 KB
/
Copy pathdocker_compose.lua
File metadata and controls
80 lines (75 loc) · 1.52 KB
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
local M = {}
M.extensions = { "yml", "yaml" }
local compose_filenames = {
["docker-compose.yml"] = true,
["docker-compose.yaml"] = true,
["compose.yml"] = true,
["compose.yaml"] = true,
}
local function is_compose_file(filename)
return compose_filenames[vim.fs.basename(filename)] == true
end
---@type CommandDescription[]
M.commands = {
{
label = "docker compose up -d",
filter = is_compose_file,
cmd = function(filename)
return {
dir = vim.fs.dirname(filename),
command_line = "docker compose up -d",
}
end,
},
{
label = "docker compose down",
filter = is_compose_file,
cmd = function(filename)
return {
dir = vim.fs.dirname(filename),
command_line = "docker compose down",
}
end,
},
{
label = "docker compose build",
filter = is_compose_file,
cmd = function(filename)
return {
dir = vim.fs.dirname(filename),
command_line = "docker compose build",
}
end,
},
{
label = "docker compose logs -f",
filter = is_compose_file,
cmd = function(filename)
return {
dir = vim.fs.dirname(filename),
command_line = "docker compose logs -f",
}
end,
},
{
label = "docker compose ps",
filter = is_compose_file,
cmd = function(filename)
return {
dir = vim.fs.dirname(filename),
command_line = "docker compose ps",
}
end,
},
{
label = "docker compose restart",
filter = is_compose_file,
cmd = function(filename)
return {
dir = vim.fs.dirname(filename),
command_line = "docker compose restart",
}
end,
},
}
return M