.gitlab-ci.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. image: tiangolo/docker-with-compose
  2. before_script:
  3. - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
  4. - pip install docker-auto-labels
  5. stages:
  6. - test
  7. - build
  8. - deploy
  9. tests:
  10. stage: test
  11. script:
  12. - sh ./scripts/test.sh
  13. tags:
  14. - build
  15. - test
  16. build-stag:
  17. stage: build
  18. script:
  19. - TAG=stag FRONTEND_ENV=staging sh ./scripts/build-push.sh
  20. only:
  21. - master
  22. tags:
  23. - build
  24. - test
  25. build-prod:
  26. stage: build
  27. script:
  28. - TAG=prod FRONTEND_ENV=production sh ./scripts/build-push.sh
  29. only:
  30. - production
  31. tags:
  32. - build
  33. - test
  34. deploy-stag:
  35. stage: deploy
  36. script:
  37. - >
  38. DOMAIN=stag.ai-anchor.com
  39. TRAEFIK_TAG=stag.ai-anchor.com
  40. STACK_NAME=stag-ai-anchor-com
  41. TAG=stag
  42. sh ./scripts/deploy.sh
  43. environment:
  44. name: staging
  45. url: https://stag.ai-anchor.com
  46. only:
  47. - master
  48. tags:
  49. - swarm
  50. - stag
  51. deploy-prod:
  52. stage: deploy
  53. script:
  54. - >
  55. DOMAIN=ai-anchor.com
  56. TRAEFIK_TAG=ai-anchor.com
  57. STACK_NAME=ai-anchor-com
  58. TAG=prod
  59. sh ./scripts/deploy.sh
  60. environment:
  61. name: production
  62. url: https://ai-anchor.com
  63. only:
  64. - production
  65. tags:
  66. - swarm
  67. - prod