forked from alcorexchange/alcor-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.bash
More file actions
60 lines (47 loc) · 2.09 KB
/
deploy.bash
File metadata and controls
60 lines (47 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Обновить код с Git
echo "Pulling latest changes from Git..."
git pull origin master
# Установить зависимости и собрать проект
echo "Installing dependencies and building the project..."
yarn install && yarn build && yarn build-server
# Удалить кэш
echo "Clearing NGINX cache..."
find /data/nginx/cache/alcor -type f -delete
# Перезапускать контейнеры для ботов
echo "Building Docker container for bots..."
docker build -f Dockerfile.apiV2.bots -t alcor-api-bots:v2 .
echo "Restarting Docker container for bots..."
docker stop alcor-api-v2-bots || true
docker rm alcor-api-v2-bots || true
docker run -d --name alcor-api-v2-bots --network=host --restart always \
-v /opt/alcor-tools:/opt/alcor-tools:ro \
-v /var/log/nginx:/var/log/nginx:ro \
alcor-api-bots:v2
# Перезапускать контейнеры для людей
echo "Building Docker container for humans..."
docker build -f Dockerfile.apiV2.humans -t alcor-api-humans:v2 .
echo "Restarting Docker container for humans..."
docker stop alcor-api-v2-humans || true
docker rm alcor-api-v2-humans || true
docker run -d --name alcor-api-v2-humans --network=host --restart always \
-v /opt/alcor-tools:/opt/alcor-tools:ro \
-v /var/log/nginx:/var/log/nginx:ro \
alcor-api-humans:v2
# Обновить Route Cache Updater
echo "Building Route Cache Updater Docker container..."
docker build -f Dockerfile.routecache-simple -t alcor-routecache:latest .
echo "Restarting Route Cache Updater container..."
docker stop alcor-routecache || true
docker rm alcor-routecache || true
docker run -d --name alcor-routecache --network=host --restart always alcor-routecache:latest
echo "Cleaning up old Docker images..."
docker image prune -af --filter "until=24h"
# Очистить build cache
echo "Cleaning up Docker build cache..."
docker builder prune -af --filter "until=24h"
# Перезапускать другие службы PM2
echo "Restarting PM2 services..."
pm2 reload all --update-env
#pm2 restart Alcor-ibc-usdt-wax-worker
echo "Deployment complete!"