-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ♻️ remove native-config dir Signed-off-by: Rintaro Okamura <[email protected]> * ➕ Use cheshire instead of jsonista Signed-off-by: Rintaro Okamura <[email protected]> * 🔥 remove csk Signed-off-by: Rintaro Okamura <[email protected]> * 🔧 Add uberjar options Signed-off-by: Rintaro Okamura <[email protected]> * 🔧 Fix Signed-off-by: Rintaro Okamura <[email protected]> * 🔧 Use Makefile for native-image build Signed-off-by: Rintaro Okamura <[email protected]> * ♻️ remove redundant imports Signed-off-by: Rintaro Okamura <[email protected]> * ✨ Add yaml Signed-off-by: Rintaro Okamura <[email protected]> * ⚡ Add upx to compress binaries Signed-off-by: Rintaro Okamura <[email protected]> * 🐛 Fix static Signed-off-by: Rintaro Okamura <[email protected]> * ✨ add sh func Signed-off-by: Rintaro Okamura <[email protected]>
- Loading branch information
Showing
13 changed files
with
138 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,10 @@ COPY src src | |
|
||
RUN lein uberjar | ||
|
||
COPY native-config native-config | ||
COPY reflection.json reflection.json | ||
COPY Makefile Makefile | ||
|
||
RUN lein native-image | ||
RUN make | ||
|
||
RUN mkdir -p /out/lib \ | ||
&& cp $JAVA_HOME/jre/lib/amd64/libsunec.so /out/lib/ \ | ||
|
@@ -34,6 +35,6 @@ LABEL maintainer "rinx <[email protected]>" | |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=graalvm /out /gitwerk-libs | ||
COPY --from=graalvm /gitwerk/target/gitwerk /gitwerk | ||
COPY --from=graalvm /gitwerk/gitwerk /gitwerk | ||
|
||
CMD ["/gitwerk", "-Djava.library.path=/gitwerk-libs/lib", "-Djavax.net.ssl.trustStore=/gitwerk-libs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
XMS = 2g | ||
XMX = 7g | ||
|
||
NATIVE_IMAGE_CONFIG_OUTPUT_DIR=native-config | ||
|
||
TARGET_JAR=target/gitwerk-0.1.0-SNAPSHOT-standalone.jar | ||
|
||
ADDITIONAL_OPTIONS="" | ||
|
||
.PHONY: all | ||
all: gitwerk | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f gitwerk | ||
rm -rf target | ||
|
||
.PHONY: profile/native-image-config | ||
profile/native-image-config: \ | ||
$(NATIVE_IMAGE_CONFIG_OUTPUT_DIR) \ | ||
$(TARGET_JAR) | ||
java -agentlib:native-image-agent=config-output-dir=$(NATIVE_IMAGE_CONFIG_OUTPUT_DIR) \ | ||
-jar $(TARGET_JAR) clone http://github.com/rinx/gitwerk | ||
(cd gitwerk; \ | ||
java -agentlib:native-image-agent=config-merge-dir=../$(NATIVE_IMAGE_CONFIG_OUTPUT_DIR) \ | ||
-jar ../$(TARGET_JAR) log) | ||
(cd gitwerk; \ | ||
java -agentlib:native-image-agent=config-merge-dir=../$(NATIVE_IMAGE_CONFIG_OUTPUT_DIR) \ | ||
-jar ../$(TARGET_JAR) tag) | ||
rm -rf gitwerk | ||
|
||
$(NATIVE_IMAGE_CONFIG_OUTPUT_DIR): | ||
mkdir -p $@ | ||
|
||
lein: | ||
curl -o lein https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein \ | ||
&& chmod a+x lein \ | ||
&& ./lein version | ||
|
||
gitwerk: \ | ||
$(TARGET_JAR) | ||
native-image \ | ||
-jar $(TARGET_JAR) \ | ||
-H:Name=gitwerk \ | ||
-H:+ReportExceptionStackTraces \ | ||
-H:Log=registerResource: \ | ||
-H:ReflectionConfigurationFiles=reflection.json \ | ||
--enable-url-protocols=http,https \ | ||
--enable-all-security-services \ | ||
-H:+JNI \ | ||
--verbose \ | ||
--no-fallback \ | ||
--no-server \ | ||
--report-unsupported-elements-at-runtime \ | ||
--initialize-at-run-time=org.eclipse.jgit.transport.HttpAuthMethod$$Digest \ | ||
--initialize-at-run-time=org.eclipse.jgit.lib.GpgSigner \ | ||
--initialize-at-run-time=io.quarkus.jsch.runtime.PortWatcherRunTime \ | ||
--initialize-at-build-time \ | ||
-H:IncludeResourceBundles=org.eclipse.jgit.internal.JGitText \ | ||
--allow-incomplete-classpath \ | ||
-J-Dclojure.spec.skip-macros=true \ | ||
-J-Dclojure.compiler.direct-linking=true \ | ||
-J-Xms$(XMS) \ | ||
-J-Xmx$(XMX) | ||
|
||
.PHONY: gitwerk-static | ||
gitwerk-static: \ | ||
$(TARGET_JAR) | ||
native-image \ | ||
-jar $(TARGET_JAR) \ | ||
-H:Name=gitwerk \ | ||
-H:+ReportExceptionStackTraces \ | ||
-H:Log=registerResource: \ | ||
-H:ReflectionConfigurationFiles=reflection.json \ | ||
--enable-url-protocols=http,https \ | ||
--enable-all-security-services \ | ||
-H:+JNI \ | ||
--verbose \ | ||
--no-fallback \ | ||
--no-server \ | ||
--report-unsupported-elements-at-runtime \ | ||
--initialize-at-run-time=org.eclipse.jgit.transport.HttpAuthMethod$$Digest \ | ||
--initialize-at-run-time=org.eclipse.jgit.lib.GpgSigner \ | ||
--initialize-at-run-time=io.quarkus.jsch.runtime.PortWatcherRunTime \ | ||
--initialize-at-build-time \ | ||
-H:IncludeResourceBundles=org.eclipse.jgit.internal.JGitText \ | ||
--allow-incomplete-classpath \ | ||
--static \ | ||
-J-Dclojure.spec.skip-macros=true \ | ||
-J-Dclojure.compiler.direct-linking=true \ | ||
-J-Xms$(XMS) \ | ||
-J-Xmx$(XMX) | ||
|
||
$(TARGET_JAR): lein src | ||
./lein uberjar |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
(ns gitwerk.internal.json | ||
(:require | ||
[jsonista.core :as jsonista] | ||
[camel-snake-kebab.core :as csk])) | ||
|
||
(def json-mapper | ||
(jsonista/object-mapper | ||
{:pretty true | ||
:decode-key-fn csk/->kebab-case-keyword})) | ||
[cheshire.core :as cheshire])) | ||
|
||
(defn read-value [obj] | ||
(jsonista/read-value obj json-mapper)) | ||
(cheshire/parse-string obj true)) | ||
|
||
(defn write-json [obj] | ||
(cheshire/generate-string obj)) | ||
|
||
(def exports | ||
{'read-value read-value}) | ||
{'read-value read-value | ||
'write-json write-json}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns gitwerk.internal.yaml | ||
(:require | ||
[clj-yaml.core :as yaml])) | ||
|
||
(defn read-value [obj] | ||
(yaml/parse-string obj)) | ||
|
||
(defn write-yaml [obj] | ||
(yaml/generate-string obj)) | ||
|
||
(def exports | ||
{'read-value read-value | ||
'write-yaml write-yaml}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
(ns gitwerk.primitives | ||
(:require | ||
[clojure.pprint :as pprint])) | ||
[clojure.pprint :as pprint] | ||
[clojure.java.shell :as shell])) | ||
|
||
(defn getenv [e] | ||
(System/getenv e)) | ||
|
||
(def clj-primitives | ||
{'pprint pprint/pprint | ||
'getenv getenv}) | ||
'getenv getenv | ||
'sh shell/sh}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters