Skip to content

Commit fb9ba1c

Browse files
committed
chore: Upgraded base image to graalvm 22.x
Closes #1
1 parent 1fa0e9a commit fb9ba1c

6 files changed

Lines changed: 82 additions & 32 deletions

File tree

.circleci/config.yml

Lines changed: 55 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1-
docker_image: &docker_image
2-
docker:
3-
- image: docker:19.03.6
4-
51
slack_image: &slack_image
62
docker:
7-
- image: devatherock/simple-slack:0.4.0
3+
- image: devatherock/simple-slack:0.7.0
4+
auth:
5+
username: $DOCKER_USERNAME
6+
password: $DOCKER_PASSWORD
87

98
work_directory: &work_directory
109
working_directory: ~/java-to-native
1110

1211
resource_class: &resource_class
1312
resource_class: small
13+
14+
executors:
15+
jdk-executor:
16+
docker:
17+
- image: cimg/openjdk:11.0
18+
auth:
19+
username: $DOCKER_USERNAME
20+
password: $DOCKER_PASSWORD
21+
<<: *resource_class
22+
<<: *work_directory
1423

1524
version: 2.1
1625
jobs:
1726
groovy_script_to_jar:
1827
docker:
1928
- image: devatherock/vela-groovy-script-to-jar:0.6.2
29+
auth:
30+
username: $DOCKER_USERNAME
31+
password: $DOCKER_PASSWORD
2032
<<: *resource_class
2133
<<: *work_directory
2234
environment:
@@ -29,21 +41,34 @@ jobs:
2941
paths:
3042
- CreateNativeImage.jar
3143
publish:
32-
<<: *docker_image
33-
<<: *resource_class
34-
<<: *work_directory
44+
executor: jdk-executor
3545
steps:
3646
- checkout
3747
- setup_remote_docker
3848
- attach_workspace:
3949
at: ~/java-to-native
4050
- run: |
41-
TAG=0.1.3
51+
TAG=${CIRCLE_SHA1:0:8}
4252
docker build -t devatherock/java-to-native:$TAG .
4353
docker tag devatherock/java-to-native:$TAG devatherock/java-to-native:latest
4454
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
4555
docker push devatherock/java-to-native:$TAG
4656
docker push devatherock/java-to-native:latest
57+
58+
publish_release:
59+
executor: jdk-executor
60+
steps:
61+
- checkout
62+
- setup_remote_docker
63+
- attach_workspace:
64+
at: ~/java-to-native
65+
- run: |
66+
TAG=${CIRCLE_TAG#v}
67+
DEV_TAG=${CIRCLE_SHA1:0:8}
68+
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
69+
docker pull devatherock/java-to-native:$DEV_TAG
70+
docker tag devatherock/java-to-native:$DEV_TAG devatherock/java-to-native:$TAG
71+
docker push devatherock/java-to-native:$TAG
4772
4873
notify_success:
4974
<<: *slack_image
@@ -55,40 +80,46 @@ jobs:
5580
TITLE: "Build completed"
5681
steps:
5782
- run: /bin/simpleslack
58-
notify_failure:
59-
<<: *slack_image
60-
<<: *resource_class
61-
environment:
62-
TEXT: "Failure: {{.CircleBuildUrl}} by {{.CircleUsername}}"
63-
COLOR: "#a1040c"
64-
CHANNEL: general
65-
TITLE: "Build completed"
66-
steps:
67-
- run:
68-
name: Failure notification
69-
command: /bin/simpleslack
70-
when: on_fail
7183

7284
workflows:
7385
version: 2.1
7486
build_publish:
7587
jobs:
7688
- groovy_script_to_jar:
89+
context:
90+
- docker-credentials
7791
filters:
7892
branches:
7993
only: master
8094
- publish:
95+
context:
96+
- docker-credentials
8197
requires:
8298
- groovy_script_to_jar
8399
- notify_success:
84100
requires:
85101
- publish
86-
- notify_failure:
102+
release:
103+
jobs:
104+
- publish_release:
105+
context:
106+
- docker-credentials
107+
filters:
108+
branches:
109+
only: non-existent-branch
110+
tags:
111+
only: /^v[0-9\.]+$/
112+
- notify_success:
113+
context:
114+
- docker-credentials
115+
- slack-webhook
87116
requires:
88-
- publish
117+
- publish_release
89118
pr_check:
90119
jobs:
91120
- groovy_script_to_jar:
121+
context:
122+
- docker-credentials
92123
filters:
93124
branches:
94125
ignore: master

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [Unreleased]
4+
### Changed
5+
- [#1](https://github.com/devatherock/java-to-native/issues/1): Upgraded base image to graalvm 22.x
6+
37
## [0.1.3] - 2020-06-21
48
### Changed
59
- Fixed the bug that was making config file mandatory

CreateNativeImage.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def nativeImageCommand = ['native-image', '-cp', classPath]
107107
if (config[CONFIG_BUILD_OVERRIDE_ARGS]) {
108108
nativeImageCommand.addAll(config[CONFIG_BUILD_OVERRIDE_ARGS])
109109
} else {
110-
nativeImageCommand.addAll([ARG_GRAPE_DISABLE, '--no-server', '--static', '--allow-incomplete-classpath',
111-
'--no-fallback', '--report-unsupported-elements-at-runtime', '--initialize-at-build-time',
110+
nativeImageCommand.addAll([ARG_GRAPE_DISABLE, '--static',
111+
'--no-fallback', '--report-unsupported-elements-at-runtime',
112112
'--enable-url-protocols=http,https', "-H:ConfigurationFileDirectories=${reflectConfigPath}"])
113113

114114
if (config[CONFIG_BUILD_ADDITIONAL_ARGS]) {

Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
FROM oracle/graalvm-ce:20.1.0-java11
1+
FROM devatherock/graalvm:ol8-java11-22.1.0-2
22

33
LABEL maintainer="devatherock@gmail.com"
4-
LABEL io.github.devatherock.version="0.1.0"
4+
LABEL io.github.devatherock.version="1.0.0"
55

6-
RUN gu install native-image
6+
RUN microdnf -y install xz \
7+
&& microdnf clean all \
8+
&& curl --location --output upx-3.96-amd64_linux.tar.xz "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz" \
9+
&& tar -xJf upx-3.96-amd64_linux.tar.xz \
10+
&& cp upx-3.96-amd64_linux/upx /bin/
711

812
COPY entry-point.sh /scripts/entry-point.sh
913
COPY CreateNativeImage.jar /scripts/CreateNativeImage.jar

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
DOCKER_TAG=latest
2+
3+
jar-build:
4+
docker run --rm \
5+
-v $(CURDIR):/work \
6+
-w=/work \
7+
-e PARAMETER_SCRIPT_PATH=CreateNativeImage.groovy \
8+
devatherock/vela-groovy-script-to-jar:0.6.2
9+
docker-build:
10+
docker build -t devatherock/java-to-native:$(DOCKER_TAG) .

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
[![Version](https://img.shields.io/docker/v/devatherock/java-to-native?sort=date)](https://hub.docker.com/r/devatherock/java-to-native/)
33
[![Docker Pulls](https://img.shields.io/docker/pulls/devatherock/java-to-native.svg)](https://hub.docker.com/r/devatherock/java-to-native/)
44
[![Docker Image Size](https://img.shields.io/docker/image-size/devatherock/java-to-native.svg?sort=date)](https://hub.docker.com/r/devatherock/java-to-native/)
5-
[![Docker Image Layers](https://img.shields.io/microbadger/layers/devatherock/java-to-native.svg)](https://microbadger.com/images/devatherock/java-to-native)
65
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
76
# java-to-native
87
CI plugin to convert a java program into a [graalvm native image](https://www.graalvm.org/docs/reference-manual/native-image/).
@@ -14,8 +13,10 @@ Execute from the working directory:
1413

1514
```
1615
docker run --rm \
17-
-e PLUGIN_JAR_NAME=YamlValidator.jar \
18-
-e PLUGIN_CONFIG_FILE=config/graal.yml \
16+
-v path/to/jar:/work \
17+
-w=/work \
18+
-e PLUGIN_JAR_NAME=/work/build/native/libs/YamlValidator.jar \
19+
-e PLUGIN_CONFIG_FILE=/work/config/graal.yml \
1920
devatherock/java-to-native:0.1.3
2021
```
2122

0 commit comments

Comments
 (0)