graalvm only for clj
This commit is contained in:
parent
1cc5c565f3
commit
03e32418e8
6 changed files with 112 additions and 2 deletions
|
@ -45,12 +45,20 @@ pypi-stable:
|
|||
script:
|
||||
- pyb -P version=$CI_COMMIT_TAG publish upload
|
||||
|
||||
clojure-image-publish:
|
||||
clj-cljs-image-publish:
|
||||
<<: *img
|
||||
<<: *tag_only
|
||||
stage: image
|
||||
script:
|
||||
- cd infrastructure/clojure && pyb image publish
|
||||
- cd infrastructure/clj-cljs && pyb image publish
|
||||
|
||||
clj-image-publish:
|
||||
<<: *img
|
||||
<<: *tag_only
|
||||
stage: image
|
||||
script:
|
||||
- cd infrastructure/clj && pyb image publish
|
||||
|
||||
|
||||
python-image-publish:
|
||||
<<: *img
|
||||
|
|
56
infrastructure/clj/build.py
Normal file
56
infrastructure/clj/build.py
Normal file
|
@ -0,0 +1,56 @@
|
|||
from os import environ
|
||||
from datetime import datetime
|
||||
from pybuilder.core import task, init
|
||||
from ddadevops import *
|
||||
|
||||
name = "ddadevops"
|
||||
MODULE = "clj"
|
||||
PROJECT_ROOT_PATH = "../.."
|
||||
version = "4.2.1-dev"
|
||||
|
||||
@init
|
||||
def initialize(project):
|
||||
image_tag = version
|
||||
if "dev" in image_tag:
|
||||
image_tag += datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
|
||||
|
||||
input = {
|
||||
"name": name,
|
||||
"module": MODULE,
|
||||
"stage": "notused",
|
||||
"project_root_path": PROJECT_ROOT_PATH,
|
||||
"build_types": ["IMAGE"],
|
||||
"mixin_types": [],
|
||||
"image_naming": "NAME_AND_MODULE",
|
||||
"image_tag": f"{image_tag}",
|
||||
}
|
||||
|
||||
project.build_depends_on("ddadevops>=4.0.0")
|
||||
|
||||
build = DevopsImageBuild(project, input)
|
||||
build.initialize_build_dir()
|
||||
|
||||
|
||||
@task
|
||||
def image(project):
|
||||
build = get_devops_build(project)
|
||||
build.image()
|
||||
|
||||
|
||||
@task
|
||||
def drun(project):
|
||||
build = get_devops_build(project)
|
||||
build.drun()
|
||||
|
||||
|
||||
@task
|
||||
def test(project):
|
||||
build = get_devops_build(project)
|
||||
build.test()
|
||||
|
||||
|
||||
@task
|
||||
def publish(project):
|
||||
build = get_devops_build(project)
|
||||
build.dockerhub_login()
|
||||
build.dockerhub_publish()
|
6
infrastructure/clj/image/Dockerfile
Normal file
6
infrastructure/clj/image/Dockerfile
Normal file
|
@ -0,0 +1,6 @@
|
|||
FROM debian:stable-slim
|
||||
|
||||
ADD resources /tmp
|
||||
RUN /tmp/install.sh
|
||||
ENV LANG=en_US.UTF-8 \
|
||||
JAVA_HOME=/usr/lib64/graalvm/graalvm-community-java17
|
2
infrastructure/clj/image/resources/CHECKSUMS
Normal file
2
infrastructure/clj/image/resources/CHECKSUMS
Normal file
|
@ -0,0 +1,2 @@
|
|||
478604fe85c711aafe8ef78c0bf25cb93fa46de5a3c07040f25a595096c43f8a kubeconform-v0.6.3.tar.gz
|
||||
094e5a7dcc4a903b70741d5c3c1688f83e83e2d44eb3d8d798c5d79ed902032c graalvm-community-jdk-17.0.7_linux-x64_bin.tar.gz
|
38
infrastructure/clj/image/resources/install.sh
Executable file
38
infrastructure/clj/image/resources/install.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
function main() {
|
||||
upgradeSystem
|
||||
|
||||
apt -qqy install curl git openjdk-17-jre-headless leiningen build-essential libz-dev zlib1g-dev;
|
||||
|
||||
# download kubeconform & graalvm
|
||||
curl -Lo /tmp/kubeconform-v0.6.3.tar.gz https://github.com/yannh/kubeconform/releases/download/v0.6.3/kubeconform-linux-amd64.tar.gz
|
||||
curl -Lo /tmp/graalvm-community-jdk-17.0.7_linux-x64_bin.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.7/graalvm-community-jdk-17.0.7_linux-x64_bin.tar.gz
|
||||
|
||||
# checksum
|
||||
cd /tmp
|
||||
sha256sum --check CHECKSUMS
|
||||
|
||||
# install kubeconform
|
||||
tar -xf /tmp/kubeconform-v0.6.3.tar.gz
|
||||
cp kubeconform /usr/local/bin
|
||||
|
||||
# install graalvm
|
||||
tar -xzf graalvm-community-jdk-17.0.7_linux-x64_bin.tar.gz
|
||||
mv graalvm-community-openjdk-17.0.7+7.1 /usr/lib/jvm/
|
||||
ln -s /usr/lib/jvm/graalvm-community-openjdk-17.0.7+7.1 /usr/lib/jvm/graalvm
|
||||
ln -s /usr/lib/jvm/graalvm/bin/gu /usr/local/bin
|
||||
update-alternatives --install /usr/bin/java java /usr/lib/jvm/graalvm/bin/java 2
|
||||
gu install native-image
|
||||
ln -s /usr/lib/jvm/graalvm/bin/native-image /usr/local/bin
|
||||
|
||||
#install pyb
|
||||
apt -qqy install python3 python3-pip;
|
||||
pip3 install pybuilder 'ddadevops>=4.2.0' deprecation dda-python-terraform boto3 pyyaml inflection --break-system-packages;
|
||||
|
||||
cleanupDocker
|
||||
}
|
||||
|
||||
source /tmp/install_functions.sh
|
||||
main
|
0
infrastructure/clj/test/.keep
Normal file
0
infrastructure/clj/test/.keep
Normal file
Loading…
Reference in a new issue