start.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # @Contact : liuyuqi.gov@msn.cn
  3. # @Time : 2024/03/19 17:10:56
  4. # @License : (C)Copyright 2022 liuyuqi.
  5. # @Desc :
  6. ###############################################################################
  7. set -e
  8. sex -x
  9. docker compose -f "docker-compose.debug.yml" up -d --build
  10. cd backend
  11. pip isntall poetry
  12. poetry install
  13. poetry shell
  14. python main.py
  15. function docker_compose_build() {
  16. docker compose build -f docker-compose.debug.yml
  17. docker compse down -v --remove-orphans
  18. docker compose up -d
  19. docker compose exec -T backend bash /app/tests-start.sh "$@"
  20. docker compose down -v --remove-orphans
  21. TAG= ${TAG?Variable not set} \
  22. FRONTEND_ENV=${FRONTEND_ENV-production} \
  23. sh ./scripts/build.sh
  24. docker compose -f docker-compose.debug.yml push
  25. }
  26. function deploy() {
  27. DOMAIN=${DOMAIN?Variable not set} \
  28. STACK_NAME=${STACK_NAME?Variable not set} \
  29. TAG=${TAG?Variable not set} \
  30. docker-compose \
  31. -f docker-compose.yml \
  32. config > docker-stack.yml
  33. docker-auto-labels docker-stack.yml
  34. docker stack deploy -c docker-stack.yml --with-registry-auth "${STACK_NAME?Variable not set}"
  35. }