From 39c9b7a048eee11b549277b0498d67d0444ab2dc Mon Sep 17 00:00:00 2001 From: geezo Date: Wed, 7 May 2025 01:45:09 +0000 Subject: [PATCH] changes --- .gitea/workflows/glance.yaml | 5 ++--- glance/test.txt | 1 + restart_container.sh | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100755 restart_container.sh diff --git a/.gitea/workflows/glance.yaml b/.gitea/workflows/glance.yaml index cb1985c..4b4d444 100644 --- a/.gitea/workflows/glance.yaml +++ b/.gitea/workflows/glance.yaml @@ -13,7 +13,6 @@ jobs: Explore-Gitea-Actions: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - name: Execute remote SSH commands using password uses: appleboy/ssh-action@v1 with: @@ -22,5 +21,5 @@ jobs: password: ${{ secrets.PASSWORD }} port: ${{ secrets.PORT }} script: | - cd /home/geezo/docker_containers/${{ env.app_folder }} && \ - docker compose -f docker-compose.yml down \ \ No newline at end of file + cd /home/geezo/docker_containers && \ + ./restart_container.sh ${{ env.app_folder }} \ \ No newline at end of file diff --git a/glance/test.txt b/glance/test.txt index a5b1a4a..5b3244f 100644 --- a/glance/test.txt +++ b/glance/test.txt @@ -1,2 +1,3 @@ sdvsdvccsddddcacssdcws sdcsdccdwc +scwdc \ No newline at end of file diff --git a/restart_container.sh b/restart_container.sh new file mode 100755 index 0000000..d8e90db --- /dev/null +++ b/restart_container.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Check if a value was provided +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +# Use the provided argument +VALUE="$1" +TARGET_DIR="/home/geezo/docker_containers/$VALUE" + +# Check if the directory exists +if [ ! -d "$TARGET_DIR" ]; then + echo "Error: Directory $TARGET_DIR does not exist." + exit 1 +fi + +# Navigate to the target directory +cd "$TARGET_DIR" || { echo "Failed to change directory to $TARGET_DIR"; exit 1; } + +# Run Docker Compose commands +docker compose down +docker compose up -d