Skip to content

Commit

Permalink
try fix redis celery
Browse files Browse the repository at this point in the history
  • Loading branch information
alwaysmeow committed Jul 17, 2024
1 parent 841b369 commit 92972d8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
docker pull alwaysmeow/webmanager-client:latest
28 changes: 28 additions & 0 deletions .github/workflows/deploy-compose.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Up Containers

on:
workflow_run:
workflows: ["Client Deploy", "Server Deploy"]
workflows: ["Client Deploy", "Server Deploy", "Compose Deploy"]
types:
- completed

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ services:
redis:
image: redis
container_name: wm-redis
command: redis-server --requirepass qwerty
ports:
- "6379:6379"
networks:
Expand Down
4 changes: 2 additions & 2 deletions server/scheduler/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 92972d8

Please sign in to comment.