-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-executable.sh
executable file
·40 lines (31 loc) · 1.08 KB
/
generate-executable.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Fail on error
set -e
echo "Build nicokosi/hubstats JAR file:"
lein uberjar
echo "Install GraalVM via SDKMAN!:"
curl --silent "https://get.sdkman.io" | bash || echo 'SDKMAN! already installed'
source "$HOME/.sdkman/bin/sdkman-init.sh"
GRAALVM_VERSION=22.1.0.r11-grl
sdkman_auto_answer=true \
sdkman_auto_selfupdate=tr \
sdk install java $GRAALVM_VERSION > /dev/null \
|| echo "GraalVM $GRAALVM_VERSION already installed."
sdk use java $GRAALVM_VERSION
echo "Build executable from JAR via GraalVM:"
gu install native-image && \
native-image \
--initialize-at-build-time \
--no-fallback \
--report-unsupported-elements-at-runtime \
-Dclojure.compiler.direct-linking=true \
-H:EnableURLProtocols=https \
-H:+ReportExceptionStackTraces \
-jar ./target/hubstats-0.1.0-SNAPSHOT-standalone.jar \
hubstats
echo "Executable has been built! ✅
It can be run this way:
# Show last 10 days stats for GitHub repository docker/containerd:
$ ./hubstats --organization docker --repository containerd --since-days 10
# Show all parameters:
$ ./hubstats"