74 lines
2.3 KiB
Makefile
74 lines
2.3 KiB
Makefile
|
|
.PHONY: swagger
|
|
|
|
swagger:
|
|
cp ../auth/swagger/auth-work.yaml ./swagger
|
|
cp ../auth/swagger/auth-work.yaml ./swagger/external
|
|
cp ../members/swagger/members-work.yaml ./swagger
|
|
cp ../members/swagger/members-work.yaml ./swagger/external
|
|
cp ../sf-gate/swagger/sf-gate-work.yaml ./swagger
|
|
cp ../sf-gate/swagger/sf-gate-work.yaml ./swagger/external
|
|
#
|
|
rm -rf api
|
|
#
|
|
# generate auth client
|
|
#
|
|
mkdir -p api/auth
|
|
swagger generate client \
|
|
--log-output=./swagger/logs/generate-auth-client.log \
|
|
--copyright-file=./build/COPYRIGHT \
|
|
--name=auth \
|
|
--spec=./swagger/auth-work.yaml \
|
|
--target=./api/auth \
|
|
--client-package=auth-client \
|
|
--model-package=auth-models \
|
|
--principal=app.User
|
|
#
|
|
# update external auth client
|
|
#
|
|
sed -i 's|"http"|"https"|g' ./swagger/external/auth-work.yaml
|
|
sed -i 's|auth.work.com:8080|gw.tnxs.net|g' ./swagger/external/auth-work.yaml
|
|
sed -i 's|"/v1"|"/work/auth/v1"|g' ./swagger/external/auth-work.yaml
|
|
#
|
|
# generate members client
|
|
#
|
|
mkdir api/members
|
|
swagger generate client \
|
|
--log-output=./swagger/logs/generate-members-client.log \
|
|
--copyright-file=./build/COPYRIGHT \
|
|
--name=members \
|
|
--spec=./swagger/members-work.yaml \
|
|
--target=./api/members \
|
|
--client-package=members-client \
|
|
--model-package=members-models \
|
|
--principal=app.User
|
|
#
|
|
# update external members client
|
|
#
|
|
sed -i 's|"http"|"https"|g' ./swagger/external/members-work.yaml
|
|
sed -i 's|members.work.com:8080|gw.tnxs.net|g' ./swagger/external/members-work.yaml
|
|
sed -i 's|"/v1"|"/work/members/v1"|g' ./swagger/external/members-work.yaml
|
|
#
|
|
# generate sfgate client
|
|
#
|
|
mkdir api/sfgate
|
|
swagger generate client \
|
|
--log-output=./swagger/logs/generate-sfgate-client.log \
|
|
--copyright-file=./build/COPYRIGHT \
|
|
--name=sfgate \
|
|
--spec=./swagger/sf-gate-work.yaml \
|
|
--target=./api/sfgate \
|
|
--client-package=sfgate-client \
|
|
--model-package=sfgate-models \
|
|
--principal=app.User
|
|
#
|
|
# update external client
|
|
#
|
|
sed -i 's|"http"|"https"|g' ./swagger/external/sf-gate-work.yaml
|
|
sed -i 's|sf-gate.members.work.com.com:8080|gw.tnxs.net|g' ./swagger/external/sf-gate-work.yaml
|
|
sed -i 's|"/v1"|"/work/sf-gate/v1"|g' ./swagger/external/sf-gate-work.yaml
|
|
#
|
|
# copy external swagger files
|
|
#
|
|
scp ./swagger/external/*.yaml root@whm.noc.tnxs.net:/home/taxassets/www/swagger/external
|