deploy
This commit is contained in:
parent
bd345354b6
commit
c5374c6694
@ -1,311 +0,0 @@
|
||||
version: "3.4"
|
||||
|
||||
|
||||
services:
|
||||
|
||||
nginx:
|
||||
image: mathwave/sprint-repo:sprint-nginx
|
||||
volumes:
|
||||
- /sprint-data/static:/var/www/html/static
|
||||
networks:
|
||||
- net
|
||||
ports:
|
||||
- "1235:80"
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
placement:
|
||||
constraints: [node.role == manager]
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
migrations:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
command: ./manage.py migrate
|
||||
networks:
|
||||
- net
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
web:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
||||
volumes:
|
||||
- /sprint-data/static:/usr/src/app/static
|
||||
command: ./manage.py runserver 0.0.0.0:8000 --noreload --insecure
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
polling:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
command: ./manage.py runserver 0.0.0.0:7998 --noreload
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
storage:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py storage
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
volumes:
|
||||
- /sprint-data/data:/usr/src/app/data
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
placement:
|
||||
constraints: [node.role == manager]
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
bot:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
command: ./manage.py bot
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: stop-first
|
||||
|
||||
checker_cleaner:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
command: ./manage.py checker_cleaner
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: stop-first
|
||||
|
||||
worker:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py receive
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
volumes:
|
||||
- /tmp:/tmp
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 2
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
file_generator:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py file_generator
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
notification_manager:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py notification_manager
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
telegram_sender:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py telegram_sender
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
email_sender:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py email_sender
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
EMAIL_PASSWORD: $EMAIL_PASSWORD
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
apply-languages:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py apply_languages
|
||||
environment:
|
||||
DB_HOST: "pg.develop.sprinthub.ru"
|
||||
FS_HOST: "storage"
|
||||
RABBIT_HOST: "rabbitmq.develop.sprinthub.ru"
|
||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
||||
RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD: $DB_PASSWORD
|
||||
DEBUG: $DEBUG
|
||||
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
networks:
|
||||
net:
|
||||
driver: overlay
|
11
.deploy/dev/.env
Normal file
11
.deploy/dev/.env
Normal file
@ -0,0 +1,11 @@
|
||||
DB_HOST=pg.develop.sprinthub.ru
|
||||
FS_HOST=storage
|
||||
RABBIT_HOST=rabbitmq.develop.sprinthub.ru
|
||||
REDIS_HOST=redis.develop.sprinthub.ru
|
||||
RABBIT_PASSWORD=$RABBIT_PASSWORD_DEV
|
||||
REDIS_PASSWORD=$REDIS_PASSWORD_DEV
|
||||
DB_PASSWORD=$DB_PASSWORD_DEV
|
||||
DEBUG=true
|
||||
TELEGRAM_TOKEN=$TELEGRAM_TOKEN_DEV
|
||||
SENTRY_TOKEN=$SENTRY_TOKEN
|
||||
EMAIL_PASSWORD=$EMAIL_PASSWORD
|
214
.deploy/dev/deploy.yaml
Normal file
214
.deploy/dev/deploy.yaml
Normal file
@ -0,0 +1,214 @@
|
||||
version: "3.4"
|
||||
|
||||
|
||||
services:
|
||||
|
||||
nginx:
|
||||
image: mathwave/sprint-repo:sprint-nginx
|
||||
volumes:
|
||||
- /sprint-data/static:/var/www/html/static
|
||||
networks:
|
||||
- net
|
||||
ports:
|
||||
- "1235:80"
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
placement:
|
||||
constraints: [node.role == manager]
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
migrations:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
command: ./manage.py migrate
|
||||
networks:
|
||||
- net
|
||||
env_file:
|
||||
- .env
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
web:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- /sprint-data/static:/usr/src/app/static
|
||||
command: ./manage.py runserver 0.0.0.0:8000 --noreload --insecure
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
polling:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
env_file:
|
||||
- .env
|
||||
command: ./manage.py runserver 0.0.0.0:7998 --noreload
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
storage:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py storage
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- /sprint-data/data:/usr/src/app/data
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
placement:
|
||||
constraints: [node.role == manager]
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
bot:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
env_file:
|
||||
- .env
|
||||
command: ./manage.py bot
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: stop-first
|
||||
|
||||
checker_cleaner:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
env_file:
|
||||
- .env
|
||||
command: ./manage.py checker_cleaner
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: stop-first
|
||||
|
||||
worker:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py receive
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- /tmp:/tmp
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 2
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
file_generator:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py file_generator
|
||||
env_file:
|
||||
- .env
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
notification_manager:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py notification_manager
|
||||
env_file:
|
||||
- .env
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
telegram_sender:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py telegram_sender
|
||||
env_file:
|
||||
- .env
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
email_sender:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py email_sender
|
||||
env_file:
|
||||
- .env
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
|
||||
apply-languages:
|
||||
image: mathwave/sprint-repo:sprint
|
||||
networks:
|
||||
- net
|
||||
command: ./manage.py apply_languages
|
||||
env_file:
|
||||
- .env
|
||||
deploy:
|
||||
mode: replicated
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
networks:
|
||||
net:
|
||||
driver: overlay
|
11
.deploy/prod/.env
Normal file
11
.deploy/prod/.env
Normal file
@ -0,0 +1,11 @@
|
||||
DB_HOST=pg.sprinthub.ru
|
||||
FS_HOST=storage
|
||||
RABBIT_HOST=rabbitmq.sprinthub.ru
|
||||
REDIS_HOST=redis.sprinthub.ru
|
||||
RABBIT_PASSWORD=$RABBIT_PASSWORD_PROD
|
||||
REDIS_PASSWORD=$REDIS_PASSWORD_PROD
|
||||
DB_PASSWORD=$DB_PASSWORD_PROD
|
||||
DEBUG=true
|
||||
TELEGRAM_TOKEN=$TELEGRAM_TOKEN_PROD
|
||||
SENTRY_TOKEN=$SENTRY_TOKEN
|
||||
EMAIL_PASSWORD=$EMAIL_PASSWORD
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -79,7 +79,6 @@ celerybeat-schedule.*
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
ENV/
|
||||
|
@ -30,12 +30,8 @@ deploy-dev:
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
when: on_success
|
||||
- when: manual
|
||||
variables:
|
||||
DB_PASSWORD: "$DB_PASSWORD_DEV"
|
||||
DEBUG: "true"
|
||||
TELEGRAM_TOKEN: "$TELEGRAM_TOKEN_DEV"
|
||||
script:
|
||||
- docker stack deploy -c ./.deploy/deploy-dev.yaml sprint
|
||||
- docker stack deploy -c ./.deploy/dev/deploy.yaml sprint
|
||||
|
||||
deploy-prod:
|
||||
extends:
|
||||
@ -46,12 +42,8 @@ deploy-prod:
|
||||
only:
|
||||
- master
|
||||
when: manual
|
||||
variables:
|
||||
DB_PASSWORD: "$DB_PASSWORD_PROD"
|
||||
DEBUG: "false"
|
||||
TELEGRAM_TOKEN: "$TELEGRAM_TOKEN_PROD"
|
||||
script:
|
||||
- docker stack deploy -c ./.deploy/deploy-prod.yaml sprint
|
||||
- docker stack deploy -c ./.deploy/prod/deploy.yaml sprint
|
||||
|
||||
push-runner:
|
||||
extends:
|
||||
|
Loading…
Reference in New Issue
Block a user