Изменил деплой

Вместо deployer - fabric/invoke
This commit is contained in:
2022-08-15 15:45:57 +03:00
parent 2c4ca426fd
commit 0cb732c803
6 changed files with 50 additions and 83 deletions

View File

@ -1,28 +0,0 @@
#!/bin/bash
set -eu
set -x
source .env
ssh_host=homepage@51.250.85.23
repo=cr.yandex/crplfk0168i4o8kd7ade
timestamp=$(date +%s)
commit=$(git rev-parse --short HEAD)
nginx_image_tag="${repo}/homepage-nginx:${commit}-${timestamp}"
echo $timestamp
echo $commit
docker build \
--file docker/Dockerfile.nginx.prod \
--tag "${nginx_image_tag}" \
"$PWD"
docker push "${nginx_image_tag}"
scp ./docker/docker-compose.prod.yml "${ssh_host}:/home/homepage/docker-compose.yml"
ssh "${ssh_host}" -t "\
cp .env .env.prod; \
echo NGINX_IMAGE=${nginx_image_tag} >> .env.prod; \
docker-compose --project-name homepage --env-file=.env.prod up --detach"