-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (38 loc) · 1.22 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
44
45
46
47
48
49
DOCKER_COMPOSE_VERSION=1.24.0
NAMESPACE=sr2020
SERVICE := platform
IMAGE := $(or ${image},${image},db)
GIT_TAG := $(shell git tag -l --points-at HEAD | cut -d "v" -f 2)
TAG := :$(or ${tag},${tag},$(or ${GIT_TAG},${GIT_TAG},latest))
ENV := $(or ${env},${env},local)
cest := $(or ${cest},${cest},)
current_dir = $(shell pwd)
build:
docker build -t ${NAMESPACE}/${IMAGE}${TAG} -t ${NAMESPACE}/${IMAGE}:latest .
push:
docker push ${NAMESPACE}/${IMAGE}
deploy:
{ \
sshpass -p $(password) ssh -o StrictHostKeyChecking=no deploy@$(server) "cd /var/services/$(SERVICE) ;\
docker-compose pull flyway ;\
docker-compose run flyway -url=jdbc:postgresql://postgres:5432/$(dbname) migrate" ;\
}
migrate:
docker-compose run flyway -url=$(url) migrate
deploy-local:
docker-compose rm -fs flyway
docker-compose up --no-deps flyway
up:
docker-compose up -d
down:
docker-compose down
restart:
docker-compose down -v
docker-compose up -d
install:
cp .env.example .env
install-docker-compose:
curl -L https://github.com/docker/compose/releases/download/$(DOCKER_COMPOSE_VERSION)/docker-compose-`uname -s`-`uname -m` > /tmp/docker-compose
chmod +x /tmp/docker-compose
sudo mv /tmp/docker-compose /usr/local/bin/docker-compose
docker-compose -v