improved nb appimage build script

This commit is contained in:
Jonathan Shook 2020-03-13 00:57:06 -05:00
parent 3772bb9364
commit 58f28e4cfb
5 changed files with 115 additions and 75 deletions

View File

@ -0,0 +1,15 @@
package io.nosqlbench.docsys.core;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.*;
public class DocsysMarkdownEndpointTest {
@Test
public void testDocLoader() {
DocsysMarkdownEndpoint ep = new DocsysMarkdownEndpoint();
String markdownList = ep.getMarkdownList(true);
}
}

1
nb/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
cache/**

View File

@ -1,73 +0,0 @@
#!/bin/bash
set -x
mkdir -p target/NB.AppDir
if [ ! -f ../target/nb.jar ]
then
print "../target/nb.jar does not exist"
exit 2
fi
if [ -x "target/nb" ]
then
printf "Removing stale target/nb...\n"
rm target/nb
fi
rsync -av skel/ target/NB.AppDir/
cp ../target/nb.jar target/NB.AppDir/usr/bin/nb.jar
( cd target/NB.AppDir && (
if [ ! -d "usr/bin/jre" ]
then
printf "getting jre...\n";
# JRE 12
wget -c https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jre_x64_linux_hotspot_12.0.2_10.tar.gz
tar xf OpenJDK12U-jre_x64_linux_hotspot_12.0.2_10.tar.gz
mv jdk-12.0.2+10-jre usr/bin/jre
rm OpenJDK12U-jre_x64_linux_hotspot_12.0.2_10.tar.gz
# JRE 13
# wget -c https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13%2B33/OpenJDK13U-jre_x64_linux_hotspot_13_33.tar.gz
# tar xf OpenJDK13U-jre_x64_linux_hotspot_13_33.tar.gz
#mv jdk-13+33-jre usr/bin/jre
#rm OpenJDK13U-jre_x64_linux_hotspot_13_33.tar.gz
else
printf "jre directory present, skipping...\n";
fi
if [ -f "AppRun" ]
then
printf "Removing stale AppRun...\n";
rm AppRun
fi
if [ ! -f "AppRun" ]
then
printf "Linking AppRun...\n";
ln -s usr/bin/nb AppRun
fi
)
)
printf "getting appimage tool and building image...\n";
( cd target && (
if [ ! -x "appimagetool-x86_64.AppImage" ]
then
wget -c https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
fi
ARCH=x86_64 ./appimagetool-x86_64.AppImage NB.AppDir nb
# && chmod +x nb
)
)
if [ -x "target/nb" ]
then
printf "nosqlbench AppImage binary was built at target/nb\n";
fi

97
nb/build-bin.sh Executable file
View File

@ -0,0 +1,97 @@
#!/bin/bash
set -x
mkdir -p target/NB.AppDir
if [ ! -f target/nb.jar ]
then
print "target/nb.jar does not exist"
exit 2
fi
#if [ -x "target/nb" ]
#then
# printf "Removing stale target/nb...\n"
# rm target/nb
#fi
rsync -av appimage/skel/ target/NB.AppDir/
cp target/nb.jar target/NB.AppDir/usr/bin/nb.jar
if [ ! -d "cache/jre" ]
then
printf "getting jre once into cache/jre\n";
mkdir -p cache
(cd cache && (
wget -c https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jre_x64_linux_hotspot_12.0.2_10.tar.gz
tar xf OpenJDK12U-jre_x64_linux_hotspot_12.0.2_10.tar.gz
mv jdk-12.0.2+10-jre jre
rm OpenJDK12U-jre_x64_linux_hotspot_12.0.2_10.tar.gz
))
fi
mkdir -p target/NB.AppDir/usr/bin/jre
rsync -av cache/jre/ target/NB.AppDir/usr/bin/jre/
if [ ! -f "target/NB.AppDir/AppRun" ]
then
( cd target/NB.AppDir && (
printf "Linking AppRun...\n";
ln -s usr/bin/nb AppRun
))
fi
#( cd target/NB.AppDir && (
# rsync -av ..
# if [ ! -d "usr/bin/jre" ]
# then
# printf "getting jre...\n";
#
# # JRE 12
# wget -c https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jre_x64_linux_hotspot_12.0.2_10.tar.gz
# tar xf OpenJDK12U-jre_x64_linux_hotspot_12.0.2_10.tar.gz
# mv jdk-12.0.2+10-jre usr/bin/jre
# rm OpenJDK12U-jre_x64_linux_hotspot_12.0.2_10.tar.gz
#
# # JRE 13
# # wget -c https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13%2B33/OpenJDK13U-jre_x64_linux_hotspot_13_33.tar.gz
# # tar xf OpenJDK13U-jre_x64_linux_hotspot_13_33.tar.gz
# #mv jdk-13+33-jre usr/bin/jre
# #rm OpenJDK13U-jre_x64_linux_hotspot_13_33.tar.gz
# else
# printf "jre directory present, skipping...\n";
# fi
#
# if [ -f "AppRun" ]
# then
# printf "Removing stale AppRun...\n";
# rm AppRun
# fi
#
# if [ ! -f "AppRun" ]
# then
# printf "Linking AppRun...\n";
# ln -s usr/bin/nb AppRun
# fi
#
# )
#)
printf "getting appimage tool and building image...\n";
( cd target && (
if [ ! -x "appimagetool-x86_64.AppImage" ]
then
wget -c https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
fi
ARCH=x86_64 ./appimagetool-x86_64.AppImage NB.AppDir nb
# && chmod +x nb
)
)
if [ -x "target/nb" ]
then
printf "nosqlbench AppImage binary was built at target/nb\n";
fi

View File

@ -189,8 +189,8 @@
<phase>package</phase>
<goals><goal>exec</goal></goals>
<configuration>
<basedir>${project.basedir}/appimage</basedir>
<executable>${project.basedir}/appimage/build</executable>
<basedir>${project.basedir}</basedir>
<executable>${project.basedir}/build-bin.sh</executable>
</configuration>
</execution>
<execution>