-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (32 loc) · 1.61 KB
/
Makefile
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
up: docker-up
init: docker-down-clear docker-pull docker-build docker-up manager-init
docker-up:
docker-compose up -d
docker-down:
docker-compose down --remove-orphans
docker-down-clear:
docker-compose down -v --remove-orphans
docker-pull:
docker-compose pull
docker-build:
docker-compose build
manager-init: manager-composer-install
manager-composer-install:
docker-compose run --rm manager-php-cli composer install
cli:
docker-compose run --rm manager-php-cli php bin/app.php
build-production:
docker build --pull --file=manager/docker/production/nginx.docker --tag ${REGISTRY_ADDRESS}/manager-nginx:${IMAGE_TAG} manager
docker build --pull --file=manager/docker/production/php-fpm.docker --tag ${REGISTRY_ADDRESS}/manager-php-fpm:${IMAGE_TAG} manager
docker build --pull --file=manager/docker/production/php-cli.docker --tag ${REGISTRY_ADDRESS}/manager-php-cli:${IMAGE_TAG} manager
push-production:
docker push ${REGISTRY_ADDRESS}/manager-nginx:${IMAGE_TAG}
docker push ${REGISTRY_ADDRESS}/manager-php-fpm:${IMAGE_TAG}
docker push ${REGISTRY_ADDRESS}/manager-php-cli:${IMAGE_TAG}
deploy-production:
ssh ${PRODUCTION_HOST} -p ${PRODUCTION_PORT} 'rm -rf docker-compose.yml .env'
scp -P ${PRODUCTION_PORT} docker-compose-production.yml ${PRODUCTION_HOST}:docker-compose.yml
ssh ${PRODUCTION_HOST} -p ${PRODUCTION_PORT} 'echo "REGISTRY_ADDRESS=${REGISTRY_ADDRESS}" >> .env'
ssh ${PRODUCTION_HOST} -p ${PRODUCTION_PORT} 'echo "IMAGE_TAG=${IMAGE_TAG}" >> .env'
ssh ${PRODUCTION_HOST} -p ${PRODUCTION_PORT} 'docker-compose pull'
ssh ${PRODUCTION_HOST} -p ${PRODUCTION_PORT} 'docker-compose --build -d