-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
43 lines (29 loc) · 942 Bytes
/
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
.PHONY: docker \
docker-build docker-push \
docker-run
DOCKER_TAG_VERSION ?= staging-latest
DOCKER_TAG_C ?= pratikmahajan/twitter-stream-source:${DOCKER_TAG_VERSION}
NAMESPACE ?= test-app
POD ?= staging-twitter-source
PROD_POD ?= prod-twitter-source
# Build and Push to docker hub
docker: docker-build docker-push
# build Docker image
docker-build:
docker build -t ${DOCKER_TAG_C} .
# Push the docker image to docker hub
docker-push:
docker push ${DOCKER_TAG_C}
# Runs the docker image on local machine
docker-run:
docker run -it --rm --net host --entrypoint /bin/sh ${DOCKER_TAG_C}
#Staging the app
staging: docker staging-rollout
# Deploy code to Production:
production:
./deploy/deploy.sh -n ${NAMESPACE} -p ${PROD_POD} -t prod
#deploy code to staging:
staging-rollout:
./deploy/deploy.sh -n ${NAMESPACE} -p ${POD} -t staging
imagestream-tag:
oc tag docker.io/${DOCKER_TAG_C} ${POD}:${DOCKER_TAG_VERSION} --scheduled