Skip to content

Commit 6503e57

Browse files
committed
ci: deploy to container workflow - remove anonymous volumes on db delete
1 parent db3c93a commit 6503e57

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

dev/deploy-to-container/cli.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,16 @@ async function main () {
8484
const containers = await dock.listContainers({ all: true })
8585
for (const container of containers) {
8686
if (container.Names.includes(`/dt-db-${branch}`) || container.Names.includes(`/dt-app-${branch}`)) {
87+
const isDbContainer = container.Names.includes(`/dt-db-${branch}`)
8788
console.info(`Terminating old container ${container.Id}...`)
8889
const oldContainer = dock.getContainer(container.Id)
8990
if (container.State === 'running') {
9091
await oldContainer.stop({ t: 5 })
9192
}
92-
await oldContainer.remove({ force: true })
93+
await oldContainer.remove({
94+
force: true,
95+
v: isDbContainer
96+
})
9397
}
9498
}
9599
console.info('Existing containers with same name have been terminated.')

0 commit comments

Comments
 (0)