Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

Commit

Permalink
add: add update.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
crab85193 committed Dec 18, 2023
1 parent 6160e97 commit faabb66
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
- name: Deploy with rsync
run: |
ssh ${{ secrets.SSH_HOST }} 'cd /home/$USER/tely-store-manager; docker-compose -f docker-compose.prod.yml down; docker system prune -a -f; docker volume prune -a -f'
rsync -auvPz ./ ${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/tely-store-manager//
rsync -auvPz ./ ${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/tely-store-manager/
ssh ${{ secrets.SSH_HOST }} 'cd /home/$USER/tely-store-manager; docker-compose -f docker-compose.prod.yml up -d --build'
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def main():
store_manager = StoreManager()
api = GoogleAPIController()

target_dir = '../static'
target_dir = './static'

shutil.rmtree(target_dir)
os.mkdir(target_dir)
Expand Down
16 changes: 16 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

CURRENT_DIR=`cd $(dirname $0) && pwd`

container_id=`docker ps -q -f status=running -f name=python`

if [ -z "$container_id" ]; then
echo "python is not running"
exit 0
fi

docker exec -it python python src/main.py

docker-compose -f docker-compose.prod.yml down

docker-compose -f docker-compose.prod.yml up -d

0 comments on commit faabb66

Please sign in to comment.