Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
deadlock-desktop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
deadlock-public
deadlock-desktop
Merge requests
!42
feat: remove devcontainers when disconnected
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
feat: remove devcontainers when disconnected
feat-remove_devcontainers_when_disconnected
into
master
Overview
8
Commits
3
Pipelines
0
Changes
12
Merged
feat: remove devcontainers when disconnected
Mohamed AZIKIOU
requested to merge
feat-remove_devcontainers_when_disconnected
into
master
Jul 21, 2022
Overview
8
Commits
3
Pipelines
0
Changes
1
0
0
Merge request reports
Compare
version 5
version 5
28802028
Jul 21, 2022
version 4
73ec7834
Jul 21, 2022
version 3
5b410b3d
Jul 21, 2022
version 2
afa4a228
Jul 21, 2022
version 1
c689f195
Jul 21, 2022
master (base)
and
latest version
latest version
f4b0a182
3 commits,
Jul 21, 2022
version 5
28802028
3 commits,
Jul 21, 2022
version 4
73ec7834
3 commits,
Jul 21, 2022
version 3
5b410b3d
2 commits,
Jul 21, 2022
version 2
afa4a228
2 commits,
Jul 21, 2022
version 1
c689f195
2 commits,
Jul 21, 2022
Show latest version
1 file
+
5
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
deadlock-plugins/deadlock-extension/src/core/utils/docker.util.ts
+
5
−
5
View file @ f4b0a182
Edit in single-file editor
Open in Web IDE
Show full file
@@ -3,14 +3,14 @@ import { promisify } from 'util';
const
exec
=
promisify
(
execCallback
);
export
async
function
getDevContainerContainers
():
Promise
<
string
[]
>
{
async
function
getDevContainerContainers
():
Promise
<
string
[]
>
{
return
(
await
exec
(
'
docker container ps -a --format {{.Names}}
'
)).
stdout
.
split
(
'
\n
'
)
.
filter
((
container
)
=>
container
.
includes
(
'
deadlock-mission-
'
));
}
async
function
removeCon
a
tainers
(...
con
a
tainers
:
string
[])
{
(
await
exec
(
`docker container rm -f
${
con
a
tainers
.
join
(
'
'
)}
`
)
).
stdout
;
async
function
removeContainers
(...
containers
:
string
[])
{
await
exec
(
`docker container rm -f
${
containers
.
join
(
'
'
)}
`
);
}
async
function
getDevContainerImages
():
Promise
<
string
[]
>
{
@@ -20,14 +20,14 @@ async function getDevContainerImages(): Promise<string[]> {
}
async
function
removeImages
(...
images
:
string
[])
{
(
await
exec
(
`docker image rm -f
${
images
.
join
(
'
'
)}
`
)
).
stdout
;
await
exec
(
`docker image rm -f
${
images
.
join
(
'
'
)}
`
);
}
export
async
function
clearDevContainers
()
{
const
containers
=
await
getDevContainerContainers
();
const
images
=
await
getDevContainerImages
();
if
(
containers
.
length
>
0
)
{
await
removeCon
a
tainers
(...
containers
);
await
removeContainers
(...
containers
);
}
if
(
images
.
length
>
0
)
{
await
removeImages
(...
images
);
Loading