Merge branch 'main' of ssh://repo.prod.meissa.de:2222/meissa/c4k-website
This commit is contained in:
commit
a9c9f51fa3
3 changed files with 69 additions and 17 deletions
|
@ -6,7 +6,7 @@ stages:
|
||||||
- image
|
- image
|
||||||
|
|
||||||
.img: &img
|
.img: &img
|
||||||
image: "domaindrivenarchitecture/ddadevops-dind:4.10.7"
|
image: "domaindrivenarchitecture/ddadevops-dind:4.11.4"
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
before_script:
|
before_script:
|
||||||
|
@ -16,7 +16,7 @@ stages:
|
||||||
- export IMAGE_TAG=$CI_COMMIT_TAG
|
- export IMAGE_TAG=$CI_COMMIT_TAG
|
||||||
|
|
||||||
.cljs-job: &cljs
|
.cljs-job: &cljs
|
||||||
image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.10.7"
|
image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.11.4"
|
||||||
cache:
|
cache:
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
key: ${CI_COMMIT_REF_SLUG}
|
||||||
paths:
|
paths:
|
||||||
|
@ -29,7 +29,7 @@ stages:
|
||||||
- npm install
|
- npm install
|
||||||
|
|
||||||
.clj-job: &clj
|
.clj-job: &clj
|
||||||
image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.10.7"
|
image: "domaindrivenarchitecture/ddadevops-clj:4.11.4"
|
||||||
cache:
|
cache:
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
key: ${CI_COMMIT_REF_SLUG}
|
||||||
paths:
|
paths:
|
||||||
|
@ -93,6 +93,15 @@ package-uberjar:
|
||||||
paths:
|
paths:
|
||||||
- target/uberjar
|
- target/uberjar
|
||||||
|
|
||||||
|
package-native:
|
||||||
|
<<: *clj
|
||||||
|
stage: package
|
||||||
|
script:
|
||||||
|
- pyb package_native
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- target/graalvm
|
||||||
|
|
||||||
release-to-clojars:
|
release-to-clojars:
|
||||||
<<: *clj
|
<<: *clj
|
||||||
<<: *tag_only
|
<<: *tag_only
|
||||||
|
|
58
build.py
58
build.py
|
@ -28,8 +28,9 @@ def initialize(project):
|
||||||
"release_organisation": "meissa",
|
"release_organisation": "meissa",
|
||||||
"release_repository_name": name,
|
"release_repository_name": name,
|
||||||
"release_artifacts": [
|
"release_artifacts": [
|
||||||
"target/uberjar/c4k-website-standalone.jar",
|
"target/graalvm/" + name,
|
||||||
"target/frontend-build/c4k-website.js",
|
"target/uberjar/" + name + "-standalone.jar",
|
||||||
|
"target/frontend-build/" + name + ".js"
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +106,59 @@ def package_uberjar(project):
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@task
|
||||||
|
def package_native(project):
|
||||||
|
run(
|
||||||
|
"mkdir -p target/graalvm",
|
||||||
|
shell=True,
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
run(
|
||||||
|
"native-image " +
|
||||||
|
"--native-image-info " +
|
||||||
|
"--report-unsupported-elements-at-runtime " +
|
||||||
|
"--no-server " +
|
||||||
|
"--no-fallback " +
|
||||||
|
"--features=clj_easy.graal_build_time.InitClojureClasses " +
|
||||||
|
"-jar target/uberjar/" + project.name + "-standalone.jar " +
|
||||||
|
"-H:IncludeResources=.*.yaml " +
|
||||||
|
"-H:IncludeResources=.*.xml " +
|
||||||
|
"-H:Log=registerResource:verbose " +
|
||||||
|
"-H:Name=target/graalvm/" + project.name + "",
|
||||||
|
shell=True,
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
run(
|
||||||
|
"sha256sum target/graalvm/" + project.name + " > target/graalvm/" + project.name + ".sha256",
|
||||||
|
shell=True,
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
run(
|
||||||
|
"sha512sum target/graalvm/" + project.name + " > target/graalvm/" + project.name + ".sha512",
|
||||||
|
shell=True,
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@task
|
||||||
|
def inst(project):
|
||||||
|
run(
|
||||||
|
"lein uberjar",
|
||||||
|
shell=True,
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
package_native(project)
|
||||||
|
run(
|
||||||
|
"sudo install -m=755 target/uberjar/" + project.name + "-standalone.jar /usr/local/bin/" + project.name + "-standalone.jar",
|
||||||
|
shell=True,
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
run(
|
||||||
|
"sudo install -m=755 target/graalvm/" + project.name + " /usr/local/bin/" + project.name + "",
|
||||||
|
shell=True,
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def upload_clj(project):
|
def upload_clj(project):
|
||||||
|
|
13
project.clj
13
project.clj
|
@ -32,15 +32,4 @@
|
||||||
["vcs" "commit"]
|
["vcs" "commit"]
|
||||||
["vcs" "tag" "v" "--no-sign"]
|
["vcs" "tag" "v" "--no-sign"]
|
||||||
["change" "version" "leiningen.release/bump-version"]]
|
["change" "version" "leiningen.release/bump-version"]]
|
||||||
:aliases {"native" ["shell"
|
)
|
||||||
"native-image"
|
|
||||||
"--report-unsupported-elements-at-runtime"
|
|
||||||
"--initialize-at-build-time"
|
|
||||||
"-jar" "target/uberjar/c4k-website-standalone.jar"
|
|
||||||
"-H:ResourceConfigurationFiles=graalvm-resource-config.json"
|
|
||||||
"-H:Log=registerResource"
|
|
||||||
"-H:Name=target/graalvm/${:name}"]
|
|
||||||
"inst" ["shell"
|
|
||||||
"sh"
|
|
||||||
"-c"
|
|
||||||
"lein uberjar && sudo install -m=755 target/uberjar/c4k-website-standalone.jar /usr/local/bin/c4k-website-standalone.jar"]})
|
|
||||||
|
|
Loading…
Reference in a new issue