From 966ebf2efb1fbe89fb62ed0deeb8c8d2e90070d3 Mon Sep 17 00:00:00 2001 From: Cosmin Constantin Lazar Date: Fri, 17 May 2024 22:37:38 +0200 Subject: [PATCH] Add deploy&run script --- scripts/deploy-latest-and-run.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 scripts/deploy-latest-and-run.sh diff --git a/scripts/deploy-latest-and-run.sh b/scripts/deploy-latest-and-run.sh new file mode 100644 index 0000000..cc2fe29 --- /dev/null +++ b/scripts/deploy-latest-and-run.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +image_name="untagged6785/ha-mitaffald" +container_name="ha-mitaffald" + +docker pull $image_name:latest + +echo "Stopping container $container_name" +docker stop $container_name || true + +echo "Removing container $container_name" +docker rm $container_name || true + +echo "Starting new container" +docker run -d --name $container_name -e affaldvarme.address.id -e mqtt.username -e mqtt.password --restart=on-failure:5 $image_name:latest \ No newline at end of file