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

chore(dist): replace wget to curl to download swagger-ui #2277

Merged
merged 20 commits into from
Aug 25, 2023
Merged
Changes from 1 commit
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
64 changes: 49 additions & 15 deletions hugegraph-dist/pom.xml
imbajin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,42 @@
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo file="${project.basedir}/dist.sh">
wget --version 1>/dev/null || exit
wget https://github.com/swagger-api/swagger-ui/archive/refs/tags/v4.15.5.tar.gz
tar zxvf v4.15.5.tar.gz
echo "window.onload = function() { window.ui = SwaggerUIBundle({
url:'/openapi.json',dom_id:'#swagger-ui',deepLinking:true,layout:'StandaloneLayout',
presets:[SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ],
plugins:[SwaggerUIBundle.plugins.DownloadUrl]});};" > swagger-ui-4.15.5/dist/swagger-initializer.js
cp -r swagger-ui-4.15.5/dist ../${final.name}/swagger-ui
</echo>
<exec executable="${shell-executable}" dir="${project.basedir}" failonerror="true">
<arg line="./dist.sh"/>
</exec>
</tasks>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath"/>
<if>
imbajin marked this conversation as resolved.
Show resolved Hide resolved
<contains string="${os.name}" substring="Linux"/>
<then>
<echo file="${project.basedir}/dist.sh">
<![CDATA[
curl --version >/dev/null || exit
# TODO: perhaps it's necessary verify the checksum before reusing the existing v4.15.5.tar.gz
if [ ! -f v4.15.5.tar.gz ]; then
curl -s -S -L -o v4.15.5.tar.gz \
https://github.com/swagger-api/swagger-ui/archive/refs/tags/v4.15.5.tar.gz
fi
tar zxf v4.15.5.tar.gz -C . > /dev/null 2>&1
echo "window.onload = function() { window.ui = SwaggerUIBundle({
url:'/openapi.json',dom_id:'#swagger-ui',deepLinking:true,layout:'StandaloneLayout',
presets:[SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ],
plugins:[SwaggerUIBundle.plugins.DownloadUrl]});};" > swagger-ui-4.15.5/dist/swagger-initializer.js
cp -r swagger-ui-4.15.5/dist ../${final.name}/swagger-ui
rm -rf dist.sh swagger-ui-4.15.5
]]>
</echo>
<exec executable="${shell-executable}"
dir="${project.basedir}"
failonerror="true">
<arg line="./dist.sh"/>
</exec>
</then>
<else>
<!-- WARN: keep msg in one line -->
<echo
message="We only download swagger-ui in Linux env, you could check pom.xml in hugegraph-dist to modify it"/>
</else>
</if>
</target>
</configuration>
</execution>
<execution>
Expand All @@ -212,6 +233,19 @@
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
<exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
imbajin marked this conversation as resolved.
Show resolved Hide resolved
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down