-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
65 lines (54 loc) · 1.88 KB
/
justfile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env just --justfile
APP := "jssl-server"
VERSION := "0.9.0"
NATIVE_DIR := "native"
alias db := docker-build
alias nl := native-linux
alias gkp := gen-keypair
alias ghp := github-push
alias gj := gradle-jar
alias c := clean
# Default recipe (this list)
default:
@just --list
# Generate keystore jssl.jks for the server
gen-keypair:
keytool -noprompt -genkeypair \
-dname "CN=jssl-server.com, OU=Burgaud, O=Burgaud, C=FRANCE" \
-keyalg RSA -alias selfsigned \
-keystore jssl.jks -storepass password \
-validity 360 -keysize 2048
# Build a docker image
docker-build: clean
docker build -t andreburgaud/{{APP}}:latest .
docker tag andreburgaud/{{APP}}:latest andreburgaud/{{APP}}:{{VERSION}}
# Native compile via container (Linux only)
native-linux: docker-build
mkdir ./bin
docker create --name {{APP}}-build andreburgaud/{{APP}}:{{VERSION}}
docker cp {{APP}}-build:/{{APP}} ./bin
docker cp {{APP}}-build:/jssl.jks ./bin
docker rm -f {{APP}}-build
zip -j bin/{{APP}}-{{VERSION}}_linux_{{arch()}}.zip ./bin/{{APP}} ./bin/jssl.jks
# Generate the jar file
gradle-jar:
./gradlew jar
# Generate the jar file
gradle-native: gradle-jar
./gradlew nativeCompile
# Build local native-image (requires GraalVM)
native-image: clean gen-keypair
./gradlew installDist
mkdir -p {{NATIVE_DIR}}/bin
native-image --initialize-at-build-time={{APP}} -Djava.security.properties==./java.security --no-fallback -jar build/install/jssl-server/lib/jssl-server.jar -o {{NATIVE_DIR}}/bin/{{APP}}
zip -j {{NATIVE_DIR}}/bin/{{APP}}-{{VERSION}}_{{os()}}_{{arch()}}.zip {{NATIVE_DIR}}/bin/{{APP}} ./jssl.jks
# Clean build and release artifacts
clean:
./gradlew clean
-rm -rf ./bin
-rm jssl.jks
# Push and tag changes to github
github-push:
git push
git tag -a {{VERSION}} -m 'Version {{VERSION}}'
git push origin --tags