Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create swagger_eventforest_client.sh #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions swagger_eventforest_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
if $Build_Codegen ; then
mvn3 clean package -Dmaven.test.skip=true
fi
if [ "$Branch" = "master" ]
then
url="https://eventforest-swagger.crm-nightly-new.cc.capillarytech.com/v2/api-docs"
version="https://eventforest-swagger.crm-nightly-new.cc.capillarytech.com/ef/meta/version"
curl -H"Authorization:Basic a3Jpc2huYS50aWxsMDE6MjAyY2I5NjJhYzU5MDc1Yjk2NGIwNzE1MmQyMzRiNzA=" -o spec.json $url
elif [ "$Branch" = "production" ]
then
url="https://eventforest-swagger.crm-nightly-new.cc.capillarytech.com/v2/api-docs"
version="https://eventforest-swagger.crm-nightly-new.cc.capillarytech.com/ef/meta/version"
curl -H"Authorization:Basic Zmlyc3RfdXNlckBjYXBpbGxhcnl0ZWNoLmNvbTo3ZmUzMmM5YjE1N2I0MDE0Y2QzOTg3MjhhYTJiM2UwYg==" -o spec.json $url
else " No Branch is selected"
fi
curl -k $version -o config.json
echo "GENERATING SDK YOO"
if [ "$Client" = "java" ]
then
java --version
rm -rf eventforest_client/java_client/java
mkdir -p eventforest_client/java_client/java
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i $url \
-l java \
--type-mappings=DateTime=DateTime \
--import-mappings=DateTime=org.joda.time.DateTime \
-DdateLibrary=java17 \
-o eventforest_client/java_client/java \
-c config.json --group-id com.capillary.platforms --model-package com.capillary.platforms.ef.models --api-package com.capillary.platforms.ef.api --artifact-id eventforest-client
tar cvzf eventforest_client/java_client/java_swagger_sdk_$BUILD_NUMBER.tar.gz -C ./eventforest_client/java_client/java/ .
mvn3 clean deploy -f eventforest_client/java_client/java/pom.xml
fpm -f -s "dir" -t "deb" -a "all" -n "eventforest-client" -v $BUILD_NUMBER -C ./eventforest_client/java_client --deb-no-default-config-files java="/usr/share/java/capillary-libs/swagger_eventforest_client"
fi
echo "SWAGGER SDK SUCCESSFULLY GENERATED"