forked from apache/openwhisk-apigateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (59 loc) · 2.38 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
DOCKER_TAG ?= snapshot-`date +'%Y%m%d-%H%M'`
DOCKER_REGISTRY ?= ''
docker:
docker build -t openwhisk/apigateway .
.PHONY: docker-ssh
docker-ssh:
docker run -ti --entrypoint='bash' openwhisk/apigateway:latest
.PHONY: test-build
test-build:
cd tests; ./install-deps.sh
.PHONY: profile-build
profile-build:
./build_profiling.sh
docker build -t openwhisk/apigateway-profiling -f Dockerfile.profiling .
.PHONY: profile-run
profile-run: profile-build
docker run --rm --name="apigateway" --privileged -p 80:80 -p ${PUBLIC_MANAGEDURL_PORT}:8080 -p 9000:9000 \
-e PUBLIC_MANAGEDURL_HOST=${PUBLIC_MANAGEDURL_HOST} -e PUBLIC_MANAGEDURL_PORT=${PUBLIC_MANAGEDURL_PORT} \
-e REDIS_HOST=${REDIS_HOST} -e REDIS_PORT=${REDIS_PORT} -e REDIS_PASS=${REDIS_PASS} \
-e TOKEN_GOOGLE_URL=https://www.googleapis.com/oauth2/v3/tokeninfo \
-e TOKEN_FACEBOOK_URL=https://graph.facebook.com/debug_token \
-e TOKEN_GITHUB_URL=https://api.github.com/user \
-e DEBUG=true \
-d openwhisk/apigateway-profiling:latest
.PHONY: test-run
test-run:
cd tests; ./run-tests.sh
.PHONY: docker-run
docker-run:
docker run --rm --name="apigateway" -p 80:80 -p ${PUBLIC_MANAGEDURL_PORT}:8080 -p 9000:9000 \
-e PUBLIC_MANAGEDURL_HOST=${PUBLIC_MANAGEDURL_HOST} -e PUBLIC_MANAGEDURL_PORT=${PUBLIC_MANAGEDURL_PORT} \
-e REDIS_HOST=${REDIS_HOST} -e REDIS_PORT=${REDIS_PORT} -e REDIS_PASS=${REDIS_PASS} \
-e TOKEN_GOOGLE_URL=https://www.googleapis.com/oauth2/v3/tokeninfo \
-e TOKEN_FACEBOOK_URL=https://graph.facebook.com/debug_token \
-e TOKEN_GITHUB_URL=https://api.github.com/user \
openwhisk/apigateway:latest
.PHONY: docker-debug
docker-debug:
#Volumes directories must be under your Users directory
mkdir -p ${HOME}/tmp/apiplatform/apigateway
rm -rf ${HOME}/tmp/apiplatform/apigateway
cp -r `pwd` ${HOME}/tmp/apiplatform/apigateway/
docker run --name="apigateway" \
-p 80:80 -p 5000:5000 \
-e "LOG_LEVEL=info" -e "DEBUG=true" \
-v ${HOME}/tmp/apiplatform/apigateway/:/etc/api-gateway \
openwhisk/apigateway:latest ${DOCKER_ARGS}
.PHONY: docker-reload
docker-reload:
cp -r `pwd` ${HOME}/tmp/apiplatform/apigateway/
docker exec apigateway api-gateway -t -p /usr/local/api-gateway/ -c /etc/api-gateway/api-gateway.conf
docker exec apigateway api-gateway -s reload
.PHONY: docker-attach
docker-attach:
docker exec -i -t apigateway bash
.PHONY: docker-stop
docker-stop:
docker stop apigateway
docker rm apigateway