Fix the builds by removing redundant already removed and stopped old instance

This commit is contained in:
juliokele 2025-07-20 11:07:47 +02:00
parent 987b1e3101
commit 61043d7866
2 changed files with 10 additions and 10 deletions

View File

@ -39,7 +39,7 @@ Remove-Item "$pwd\src\bitBetter\cert.cert" -Force
# gather all running instances # gather all running instances
$oldinstances = docker container ps --all -f Name=bitwarden --format '{{.ID}}' $oldinstances = docker container ps --all -f Name=bitwarden --format '{{.ID}}'
# stop all running instances # stop and remove all running instances
foreach ($instance in $oldinstances) { foreach ($instance in $oldinstances) {
docker stop $instance docker stop $instance
docker rm $instance docker rm $instance
@ -58,10 +58,10 @@ else
} }
} }
# stop and remove previous existing patch(ed) container # remove previous existing patch(ed) image
docker stop bitwarden-patch if (docker image ls -q bitwarden-patch) {
docker rm bitwarden-patch docker image rm bitwarden-patch
docker image rm bitwarden-patch }
# start a new bitwarden instance so we can patch it # start a new bitwarden instance so we can patch it
$patchinstance = docker run -d --name bitwarden-patch ghcr.io/bitwarden/self-host:beta $patchinstance = docker run -d --name bitwarden-patch ghcr.io/bitwarden/self-host:beta

View File

@ -40,7 +40,7 @@ rm -f "$PWD/src/bitBetter/cert.cert"
# gather all running instances # gather all running instances
OLDINSTANCES=$(docker container ps --all -f Name=bitwarden --format '{{.ID}}') OLDINSTANCES=$(docker container ps --all -f Name=bitwarden --format '{{.ID}}')
# stop all running instances # stop and remove all running instances
for INSTANCE in ${OLDINSTANCES[@]}; do for INSTANCE in ${OLDINSTANCES[@]}; do
docker stop $INSTANCE docker stop $INSTANCE
docker rm $INSTANCE docker rm $INSTANCE
@ -58,10 +58,10 @@ else
fi fi
fi fi
# stop and remove previous existing patch(ed) container # remove previous existing patch(ed) image
docker stop bitwarden-patch if [ "$(docker image ls -q bitwarden-patch)" ]; then
docker rm bitwarden-patch docker image rm bitwarden-patch
docker image rm bitwarden-patch fi
# start a new bitwarden instance so we can patch it # start a new bitwarden instance so we can patch it
PATCHINSTANCE=$(docker run -d --name bitwarden-patch ghcr.io/bitwarden/self-host:beta) PATCHINSTANCE=$(docker run -d --name bitwarden-patch ghcr.io/bitwarden/self-host:beta)