Skip to content

Commit

Permalink
--
Browse files Browse the repository at this point in the history
  • Loading branch information
devansh-singh2351 committed Nov 28, 2024
1 parent 10c58a0 commit 86a2f4b
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 4 deletions.
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"artifactVersion":"1.40-SNAPSHOT"}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions modules/swagger-codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
<artifactId>maven-plugin-api</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.9</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
Expand Down
23 changes: 21 additions & 2 deletions modules/swagger-codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>2.10</version>
<artifactId>wagon-ssh</artifactId>
<version>2.9</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
Expand Down Expand Up @@ -110,6 +110,11 @@
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.3.3</version>
</plugin>
</plugins>
</build>
<profiles>
Expand Down Expand Up @@ -286,4 +291,18 @@
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>capillarymavenrepo</id>
<name>Capillary Maven Repo</name>
<url>scp://[email protected]/data/mvn/releases</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>capillarymavensnapshotrepo</id>
<name>Capillary Maven Snapshot Repo</name>
<url>scp://[email protected]/data/mvn/snapshots</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
</project>
35 changes: 35 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,41 @@
</snapshots>
</repository>
</repositories>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Make sure wagon-ssh is available -->
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.3.4</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>capillarymavenrepo</id>
<name>Capillary Maven Repo</name>
<url>scp://[email protected]/data/mvn/releases</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>capillarymavensnapshotrepo</id>
<name>Capillary Maven Snapshot Repo</name>
<url>scp://[email protected]/data/mvn/snapshots</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<properties>
<swagger-parser-version>1.0.24</swagger-parser-version>
<scala-version>2.11.1</scala-version>
Expand Down
4 changes: 2 additions & 2 deletions swagger_sdk_gen_v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ echo "GENERATING SDK"
if [ "$Client" = "java" ]
then
rm -rf intouch_api/java_client/java
curl -O https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.36/swagger-codegen-cli-3.0.36.jar
java -jar swagger-codegen-cli-3.0.36.jar generate \
curl -O https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.9/swagger-codegen-cli-3.0.9.jar
java -jar swagger-codegen-cli-3.0.9.jar generate \
-i $url \
-l java \
-DdateLibrary=java8 \
Expand Down
70 changes: 70 additions & 0 deletions swagger_sdk_v3_jsvt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
if $Build_Codegen; then
mvn3 clean package -Dmaven.test.skip=true
fi

echo "{\"artifactVersion\":\"1.40-SNAPSHOT\"}" >config.json
echo "GENERATING SDK"

if [ "$Branch" = "snapshot" ]
then
url="https://intouch-api-v3-swagger.crm-nightly-new.cc.capillarytech.com/v3/api-docs"
version="https://intouch-api-v3-swagger.crm-nightly-new.cc.capillarytech.com/v3/meta/version"
elif [ "$Branch" = "production" ]
then
url="https://intouch-api-v3-swagger.crm-staging-new.cc.capillarytech.com/v3/api-docs"
version="https://intouch-api-v3-swagger.crm-staging-new.cc.capillarytech.com/v3/meta/version"
else
"No Branch is selected"
fi

if [ "$Client" = "java" ]; then
rm -rf intouch_api/java_client/java
java -jar modules/swagger-codegen-cli-jsvt/target/swagger-codegen-cli.jar generate \
-i $url \
-l java \
-DdateLibrary=java8 \
-DjavaVersion=17 \
-o intouch_api/java_client/java \
-c config.json
tar cvzf intouch_api/java_client/java_swagger_sdk_$BUILD_NUMBER.tar.gz -C ./intouch_api/java_client/java/ .
mvn3 clean deploy -f intouch_api/java_client/java/pom.xml
fpm -f -s "dir" -t "deb" -a "all" -n "java-swagger-v3-sdk" -v $BUILD_NUMBER -C ./intouch_api/java_client --deb-no-default-config-files java="/usr/share/java/capillary-libs/swagger-v3-sdk"


elif [ "$Client" = "c#" ]
then rm -rf intouch_api/csharp_client/c#
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i $url \
-l csharp\
-DtargetFramework=v$Version \
-o intouch_api/csharp_client/c#
tar cvzf intouch_api/csharp_client/c#swagger_sdK_$BUILD_NUMBER.tar.gz -C ./intouch_api/csharp_client/c#/ .
fpm -f -s "dir" -t "deb" -a "all" -n "c#-swagger-v3-sdk" -v $BUILD_NUMBER -C ./intouch_api/csharp_client --deb-no-default-config-files csharp="/usr/share/c#/capillary-libs/swagger-v3-sdk"
elif [ "$Client" = "php" ]
then rm -rf intouch_api/php_client/php
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i $url \
-l php \
-o intouch_api/php_client/php \
-c config_php.json
tar cvzf intouch_api/php_client/php_swagger_sdk_$BUILD_NUMBER.tar.gz -C ./intouch_api/php_client/php/ .
fpm -f -s "dir" -t "deb" -a "all" -n "swagger-v3-sdk" -v $BUILD_NUMBER -C ./intouch_api/php_client --deb-no-default-config-files php="/usr/share/php/capillary-libs/swagger-v3-sdk"
elif [ "$Client" = "nodejs" ]
then rm -rf intouch_api/nodejs_client
mkdir -p intouch_api/nodejs_client/
curl $url > swagger.json
npm install swagger-js-codegen
cd swagger-js-codegen
node ../nodejs_sdk_gen > ../intouch_api/nodejs_client/node_$BUILD_NUMBER
fpm -f -s "dir" -t "deb" -a "all" -n "node-swagger-v3-sdk" -v $BUILD_NUMBER -C ./intouch_api/nodejs_client --deb-no-default-config-files nodejs="/usr/share/nodejs/capillary-libs/swagger-v3-sdk"
elif [ "$Client" = "python" ]
then rm -rf intouch_api/python_client
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i $url \
-l python \
-o intouch_api/python_client/python
tar cvzf intouch_api/python_client/python_swagger_sdk_$BUILD_NUMBER.tar.gz -C ./intouch_api/python_client/python/ .
fpm -f -s "dir" -t "deb" -a "all" -n "py-swagger-v3-sdk" -v $BUILD_NUMBER -C ./intouch_api/python_client --deb-no-default-config-files python="/usr/share/python/capillary-libs/swagger-v3-sdk"
else " no client is selected"
fi
echo "SWAGGER SDK SUCCESSFULLY GENERATED"

0 comments on commit 86a2f4b

Please sign in to comment.