Skip to content

Commit ad9a4ba

Browse files
author
mahesh bisl
committed
Added Makefile
1 parent 4e8bfa0 commit ad9a4ba

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
VERSION:=9.5
2+
TAG:=base
3+
APP:=postgres
4+
#NOTE: CNAME will not work because of the certificates
5+
REPO:=822924222578.dkr.ecr.us-east-1.amazonaws.com/$(APP)
6+
URL:=$(REPO):$(TAG)
7+
8+
default:
9+
@echo "Usage make [image | stopdb | rundb | runpsql | commit | push | check]"
10+
11+
image:
12+
`aws ecr get-login --region us-east-1`
13+
echo "Building $(APP)"
14+
docker build -t $(URL) $(VERSION)/.
15+
make push
16+
17+
stopdb:
18+
-docker rm -f $(APP)
19+
20+
rundb:stopdb
21+
docker run -d --name $(APP) -e POSTGRES_PASSWORD=password $(URL)
22+
23+
runpsql:
24+
docker run -it --rm --link $(APP):postgres postgres psql -h postgres -U postgres
25+
26+
commit:
27+
docker commit $(APP) $(URL)
28+
make push
29+
30+
push:
31+
docker push $(URL)
32+
33+
check:
34+
docker ps -f name=$(APP)
35+
docker images $(URL)
36+
37+
clean:
38+
-docker rmi $(cmd docker images -a | grep "^<none>" | awk '{print $3}')
39+
-docker rmi $(cmd docker images -a | grep "$(REPO)" | awk '{print $3}')
40+
41+

0 commit comments

Comments
 (0)