Skip to content

Commit

Permalink
Merge pull request #1009 from gabilang/update-workflow-java-version
Browse files Browse the repository at this point in the history
Update Java versions and fix test failures
  • Loading branch information
gabilang committed Aug 10, 2023
2 parents de15570 + 2308d94 commit 2ba0073
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-timestamped-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
java-version: 17.0.7
- name: Change to Timestamped Version
run: |
startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
java-version: 17.0.7
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
java-version: 17.0.7
- name: Set version env variable
run: echo "VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)" >> $GITHUB_ENV
- name : Pre release depenency version update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
java-version: 17.0.7
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
uses: actions/checkout@v3
- name: Build an image from Dockerfile
run: |
docker build --no-cache=true -t ballerina/jre17:v1 ./base/base-image
docker build --no-cache=true -t ballerina/jre11:v1 ./base/base-image
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'ballerina/jre17:v1'
image-ref: 'ballerina/jre11:v1'
format: 'table'
exit-code: '1'
ignore-unfixed: true
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ext.ballerinaLangVersion = project.ballerinaLangVersion
ext.ballerinaSourceDirectory = "$buildDir/../src/main/ballerina"
ext.commonsCodecVersion = "1.12"
ext.commonIoVersion = "2.6"
ext.dockerJavaVersion = "3.3.1"
ext.dockerJavaVersion = "3.3.2"
ext.puppycrawlCheckstyleVersion = "10.12.1"
ext.projectBuildSourceEncoding = "UTF-8"
ext.projectReportingOutputEncoding = "UTF-8"
Expand Down
1 change: 1 addition & 0 deletions docker-generator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ test {
useTestNG() {
suites 'src/test/resources/testng.xml'
}
jvmArgs = ['--add-opens=java.base/java.util=ALL-UNNAMED']
}
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private String generateThinJarDockerfile() {
}

private void appendUser(StringBuilder dockerfileContent) {
if (this.dockerModel.getBaseImage().equals(DockerGenConstants.OPENJDK_17_JRE_SLIM_BASE)) {
if (this.dockerModel.getBaseImage().equals(DockerGenConstants.OPENJDK_11_JRE_SLIM_BASE)) {
dockerfileContent.append("RUN addgroup troupe \\").append(System.lineSeparator());
dockerfileContent.append(" && adduser -S -s /bin/bash -g 'ballerina' -G troupe -D ballerina \\")
.append("\n");
Expand Down Expand Up @@ -392,7 +392,7 @@ private void appendCommonCommands(StringBuilder dockerfileContent) {
this.dockerModel.getPorts().forEach(port -> dockerfileContent.append(" ").append(port));
}
dockerfileContent.append(System.lineSeparator());
if (this.dockerModel.getBaseImage().equals(DockerGenConstants.OPENJDK_17_JRE_SLIM_BASE)) {
if (this.dockerModel.getBaseImage().equals(DockerGenConstants.OPENJDK_11_JRE_SLIM_BASE)) {
dockerfileContent.append("USER ballerina").append("\n");
dockerfileContent.append(System.lineSeparator());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class DockerGenConstants {
public static final String EXECUTABLE_JAR = ".jar";
public static final String REGISTRY_SEPARATOR = "/";
public static final String TAG_SEPARATOR = ":";
public static final String OPENJDK_17_JRE_SLIM_BASE = "ballerina/jre17:v1";
public static final String OPENJDK_17_JRE_WINDOWS_BASE_IMAGE = "openjdk:17-windowsservercore";
public static final String OPENJDK_11_JRE_SLIM_BASE = "ballerina/jre11:v1";
public static final String OPENJDK_11_JRE_WINDOWS_BASE_IMAGE = "openjdk:11-windowsservercore";

}
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public DockerModel() {
// Initialize with default values except for image name
this.tag = "latest";
this.buildImage = true;
this.baseImage = windowsBuild ? DockerGenConstants.OPENJDK_17_JRE_WINDOWS_BASE_IMAGE :
DockerGenConstants.OPENJDK_17_JRE_SLIM_BASE;
this.baseImage = windowsBuild ? DockerGenConstants.OPENJDK_11_JRE_WINDOWS_BASE_IMAGE :
DockerGenConstants.OPENJDK_11_JRE_SLIM_BASE;
this.enableDebug = false;
this.debugPort = 5005;
this.setDockerAPIVersion(System.getenv(DOCKER_API_VERSION));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void validateDockerFile() throws IOException {
String dockerFileContent = new String(Files.readAllBytes(dockerFile.toPath()));
Assert.assertTrue(dockerFileContent.contains("CMD java -Xdiag -cp \"hello.jar:jars/*\" " +
"'wso2/bal/1/$_init'"));
Assert.assertTrue(dockerFileContent.contains("FROM openjdk:17-windowsservercore"));
Assert.assertTrue(dockerFileContent.contains("FROM openjdk:11-windowsservercore"));
}

private Set<Path> getJarFilePaths() throws IOException {
Expand Down
2 changes: 1 addition & 1 deletion load-tests/h2_h1c_passthrough/src/Cloud.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[container.image]
repository = "ballerina"
name = "h2_h1c_passthrough"
base = "xlight05/jre17:v1"
base = "xlight05/jre11:v1"

[[container.copy.files]]
sourceFile="./security/ballerinaKeystore.p12"
Expand Down

0 comments on commit 2ba0073

Please sign in to comment.