2021-03-19 11:14:50 +00:00
|
|
|
# install graalvm
|
2021-03-19 19:36:21 +00:00
|
|
|
|
|
|
|
```
|
2021-03-19 11:14:50 +00:00
|
|
|
curl -LO https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.0.0.2/graalvm-ce-java11-linux-amd64-21.0.0.2.tar.gz
|
2021-03-19 11:12:45 +00:00
|
|
|
|
2021-03-19 11:14:50 +00:00
|
|
|
# unpack
|
|
|
|
tar -xzf graalvm-ce-java11-linux-amd64-21.0.0.2.tar.gz
|
2021-03-19 11:12:45 +00:00
|
|
|
|
2021-03-19 19:36:21 +00:00
|
|
|
sudo mv graalvm-ce-java11-21.0.0.2 /usr/lib/jvm/
|
|
|
|
sudo ln -s /usr/lib/jvm/graalvm-ce-java11-21.0.0.2 /usr/lib/jvm/graalvm
|
|
|
|
sudo ln -s /usr/lib/jvm/graalvm/bin/gu /usr/local/bin
|
|
|
|
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/graalvm/bin/java 2
|
|
|
|
sudo update-alternatives --config java
|
|
|
|
|
2021-03-19 11:14:50 +00:00
|
|
|
# install native-image in graalvm-ce-java11-linux-amd64-21.0.0.2/bin
|
2021-03-19 19:36:21 +00:00
|
|
|
sudo gu install native-image
|
|
|
|
sudo ln -s /usr/lib/jvm/graalvm/bin/native-image /usr/local/bin
|
2021-03-19 11:12:45 +00:00
|
|
|
|
2021-03-19 11:14:50 +00:00
|
|
|
# deps
|
|
|
|
sudo apt-get install build-essential libz-dev zlib1g-dev
|
|
|
|
|
2021-03-19 19:36:21 +00:00
|
|
|
# build
|
2021-03-25 22:50:17 +00:00
|
|
|
cd ~/repo/dda/k8s-mastodon-bot
|
2021-03-19 19:36:21 +00:00
|
|
|
lein uberjar
|
2021-03-26 12:54:11 +00:00
|
|
|
mkdir -p target/graalvm
|
2021-03-19 19:36:21 +00:00
|
|
|
lein native
|
|
|
|
|
2021-03-19 12:36:54 +00:00
|
|
|
# execute
|
2021-03-26 12:54:11 +00:00
|
|
|
./target/graalvm/k8s-mastodon-bot -h
|
|
|
|
./target/graalvm/k8s-mastodon-bot src/test/resources/valid-config.edn src/test/resources/valid-auth.edn
|
|
|
|
./target/graalvm/k8s-mastodon-bot src/test/resources/invalid-config.edn src/test/resources/invalid-auth.edn
|
2021-03-19 12:36:54 +00:00
|
|
|
```
|