From 92972d82d0c5b486a61ff02f5228df25cd5dcd4c Mon Sep 17 00:00:00 2001 From: Sergey Krivtsov <130004663+alwaysmeow@users.noreply.github.com> Date: Wed, 17 Jul 2024 06:44:19 +0300 Subject: [PATCH] try fix redis celery --- .github/workflows/deploy-client.yml | 3 +-- .github/workflows/deploy-compose.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/up.yml | 2 +- docker-compose.yml | 1 + server/scheduler/tasks.py | 4 ++-- 5 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/deploy-compose.yml diff --git a/.github/workflows/deploy-client.yml b/.github/workflows/deploy-client.yml index 44caf68..098b922 100644 --- a/.github/workflows/deploy-client.yml +++ b/.github/workflows/deploy-client.yml @@ -43,5 +43,4 @@ jobs: docker rm -f wm-client || true docker rmi -f alwaysmeow/webmanager-client || true git pull origin prod - docker pull alwaysmeow/webmanager-client:latest - docker-compose up -d \ No newline at end of file + docker pull alwaysmeow/webmanager-client:latest \ No newline at end of file diff --git a/.github/workflows/deploy-compose.yml b/.github/workflows/deploy-compose.yml new file mode 100644 index 0000000..5443f12 --- /dev/null +++ b/.github/workflows/deploy-compose.yml @@ -0,0 +1,28 @@ +name: Compose Deploy +on: + push: + paths: + - './docker-compose.yml' + +jobs: + checkout: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + deploy-compose: + needs: build-and-push-client-image + runs-on: ubuntu-latest + steps: + - name: SSH connection + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.SERVER_USER }} + password: ${{ secrets.SERVER_PASSWORD }} + port: 22 + script: | + cd app/WebManager + docker-compose stop + git pull origin prod \ No newline at end of file diff --git a/.github/workflows/up.yml b/.github/workflows/up.yml index 8aca0cb..3d47f1f 100644 --- a/.github/workflows/up.yml +++ b/.github/workflows/up.yml @@ -2,7 +2,7 @@ name: Up Containers on: workflow_run: - workflows: ["Client Deploy", "Server Deploy"] + workflows: ["Client Deploy", "Server Deploy", "Compose Deploy"] types: - completed diff --git a/docker-compose.yml b/docker-compose.yml index 3813f8f..7c037e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,6 +52,7 @@ services: redis: image: redis container_name: wm-redis + command: redis-server --requirepass qwerty ports: - "6379:6379" networks: diff --git a/server/scheduler/tasks.py b/server/scheduler/tasks.py index fd4748c..b9a2dbe 100644 --- a/server/scheduler/tasks.py +++ b/server/scheduler/tasks.py @@ -7,8 +7,8 @@ from mail import mail from tools.keygen import generateKey -# url = "redis://localhost:6379/0" -url = "redis://redis:6379/0" +# url = "redis://:qwerty@localhost:6379/0" +url = "redis://:qwerty@redis:6379/0" celery = Celery("WebManagerTasks", broker=url)