lib/Makefile

53 lines
1.6 KiB
Makefile

.PHONY: swagger
swagger:
cp ../auth/swagger/auth-work.yaml ./swagger
cp ../auth/swagger/auth-work.yaml ./swagger/external
cp ../workflow/swagger/workflow-work.yaml ./swagger
cp ../workflow/swagger/workflow-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"|"/vk/auth/v1"|g' ./swagger/external/auth-work.yaml
#
# generate workflow client
#
mkdir api/workflow
swagger generate client \
--log-output=./swagger/logs/generate-workflow-client.log \
--copyright-file=./build/COPYRIGHT \
--name=workflow \
--spec=./swagger/workflow-work.yaml \
--target=./api/workflow \
--client-package=workflow-client \
--model-package=workflow-models \
--principal=app.User
#
# update external workflow client
#
sed -i 's|"http"|"https"|g' ./swagger/external/workflow-work.yaml
sed -i 's|workflow.work.com:8080|gw.tnxs.net|g' ./swagger/external/workflow-work.yaml
sed -i 's|"/v1"|"/vk/workflow/v1"|g' ./swagger/external/workflow-work.yaml
#
# copy external swagger files
#
scp ./swagger/external/*.yaml root@whm.noc.tnxs.net:/home/taxassets/www/swagger/external