Skip to content

Commit

Permalink
run correct bash file
Browse files Browse the repository at this point in the history
  • Loading branch information
nemanjam committed Jun 7, 2024
1 parent d78ac5a commit 12d1b57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 11 additions & 2 deletions docs/temp-code/deploy-docker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# REMOTE_PATH="~/traefik-proxy/apps/nmc-docker"
# REMOTE_HOST="arm1"

REMOTE_HOST=$1
REMOTE_PATH=$2
IMAGE_NAME_WITH_TAG=$3
Expand All @@ -13,8 +16,14 @@ fi
# Navigate to the docker-compose.yml folder
ssh $REMOTE_HOST "cd $REMOTE_PATH && \
echo 'Old image id:' && \
\$(docker image ls --format='{{.Repository}}:{{.ID}}' | grep '$IMAGE_NAME_WITH_TAG')
docker compose down && \
docker image rm $IMAGE_NAME_WITH_TAG && \
docker image rm '$IMAGE_NAME_WITH_TAG' && \
docker compose up -d"
docker compose up -d && \
echo 'New image id:' && \
\$(docker image ls --format='{{.Repository}}:{{.ID}}' | grep '$IMAGE_NAME_WITH_TAG')"

13 changes: 2 additions & 11 deletions scripts/deploy-docker.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

# REMOTE_PATH="~/traefik-proxy/apps/nmc-docker"
# REMOTE_HOST="arm1"

REMOTE_HOST=$1
REMOTE_PATH=$2
IMAGE_NAME_WITH_TAG=$3
Expand All @@ -16,14 +13,8 @@ fi
# Navigate to the docker-compose.yml folder
ssh $REMOTE_HOST "cd $REMOTE_PATH && \
echo 'Old image id:' && \
\$(docker image ls --format='{{.Repository}}:{{.ID}}' | grep '$IMAGE_NAME_WITH_TAG')
docker compose down && \
docker image rm '$IMAGE_NAME_WITH_TAG' && \
docker image rm $IMAGE_NAME_WITH_TAG && \
docker compose up -d && \
echo 'New image id:' && \
\$(docker image ls --format='{{.Repository}}:{{.ID}}' | grep '$IMAGE_NAME_WITH_TAG')"
docker compose up -d"

0 comments on commit 12d1b57

Please sign in to comment.