Skip to content

Commit

Permalink
tasks.py: 简化部署脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryJi529 committed Apr 28, 2024
1 parent dca1a2e commit 60a892c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,19 +475,19 @@ def updateDocker(c: Connection):
pass
c.run("docker system prune -af")

colored_print("部署容器...")
colored_print("容器编排与启动...")
c.run(
f"cd ~/morningstar/scripts/deploy; docker-compose build && docker-compose up -d"
)

colored_print("转移媒体文件...")
c.run("docker cp ~/morningstar/media morningstar_django:/app")

colored_print("启动supervisor管理Django进程...")
c.run("docker exec -i morningstar_django service supervisor start")
# NOTE: 重启Django确保数据库无连接错误
colored_print("生产环境部署...")
c.run("docker exec -i morningstar_django bash /production.sh")
c.run("docker exec -i morningstar_django supervisorctl start django")

colored_print("通过supervisor启动Django进程...")
c.run("docker exec -i morningstar_django service supervisor start")

colored_print("配置HTTPS...")
# certbot certonly --manual --preferred-challenge dns -d django.morningstar.com # NOTE: 手动配置
Expand Down

0 comments on commit 60a892c

Please sign in to comment.