From f6180f15d02412f54ef9d2c7dacb8c78753fed24 Mon Sep 17 00:00:00 2001 From: Sandesh <30489233+j-sandy@users.noreply.github.com> Date: Thu, 24 Oct 2024 21:16:30 +0530 Subject: [PATCH] chore(java17): Upgrade java runtime to JRE17 and compilation using JDK17, but target remains Java11 (#2189) --- .github/workflows/build.yml | 6 ++++-- .github/workflows/pr.yml | 6 ++++-- .github/workflows/release.yml | 8 +++++--- Dockerfile.compile | 2 +- Dockerfile.slim | 7 ++----- Dockerfile.ubuntu | 2 +- gradle.properties | 2 +- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3c67e5c9e..eb03c72e3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,9 @@ jobs: uses: docker/setup-buildx-action@v3 - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: | + 17 + 11 distribution: 'zulu' cache: 'gradle' - name: Prepare build variables @@ -36,7 +38,7 @@ jobs: - name: Build env: ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }} - run: ./gradlew build --stacktrace ${{ steps.build_variables.outputs.REPO }}-web:installDist + run: ./gradlew -PenableCrossCompilerPlugin=true build --stacktrace ${{ steps.build_variables.outputs.REPO }}-web:installDist - name: Build local slim container image for testing uses: docker/build-push-action@v6 with: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5d37a11572..ecfd790c2d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -19,7 +19,9 @@ jobs: uses: docker/setup-buildx-action@v3 - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: | + 17 + 11 distribution: 'zulu' cache: 'gradle' - name: Prepare build variables @@ -30,7 +32,7 @@ jobs: - name: Build env: ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }} - run: ./gradlew build ${{ steps.build_variables.outputs.REPO }}-web:installDist + run: ./gradlew -PenableCrossCompilerPlugin=true build ${{ steps.build_variables.outputs.REPO }}-web:installDist - name: Build slim container image uses: docker/build-push-action@v6 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 711bb4568b..25e4e8c014 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,9 @@ jobs: uses: docker/setup-buildx-action@v3 - uses: actions/setup-java@v4 with: - java-version: 11 + java-version: | + 17 + 11 distribution: 'zulu' cache: 'gradle' - name: Assemble release info @@ -50,14 +52,14 @@ jobs: ORG_GRADLE_PROJECT_nexusPgpSigningKey: ${{ secrets.NEXUS_PGP_SIGNING_KEY }} ORG_GRADLE_PROJECT_nexusPgpSigningPassword: ${{ secrets.NEXUS_PGP_SIGNING_PASSWORD }} run: | - ./gradlew --info build ${{ steps.build_variables.outputs.REPO }}-web:installDist publishToNexus closeAndReleaseNexusStagingRepository + ./gradlew -PenableCrossCompilerPlugin=true --info build ${{ steps.build_variables.outputs.REPO }}-web:installDist publishToNexus closeAndReleaseNexusStagingRepository - name: Publish apt packages to Google Artifact Registry env: ORG_GRADLE_PROJECT_version: ${{ steps.release_info.outputs.RELEASE_VERSION }} ORG_GRADLE_PROJECT_artifactRegistryPublishEnabled: true GAR_JSON_KEY: ${{ secrets.GAR_JSON_KEY }} run: | - ./gradlew --info publish + ./gradlew -PenableCrossCompilerPlugin=true --info publish - name: Login to GAR # Only run this on repositories in the 'spinnaker' org, not on forks. if: startsWith(github.repository, 'spinnaker/') diff --git a/Dockerfile.compile b/Dockerfile.compile index 202cbe6cb9..30b608531e 100644 --- a/Dockerfile.compile +++ b/Dockerfile.compile @@ -1,6 +1,6 @@ FROM ubuntu:bionic RUN apt-get update && apt-get install -y \ - openjdk-11-jdk \ + openjdk-17-jdk \ && rm -rf /var/lib/apt/lists/* LABEL maintainer="sig-platform@spinnaker.io" ENV GRADLE_USER_HOME /workspace/.gradle diff --git a/Dockerfile.slim b/Dockerfile.slim index b2cd71021e..d2d1f9f98e 100644 --- a/Dockerfile.slim +++ b/Dockerfile.slim @@ -1,4 +1,4 @@ -FROM alpine:3.11 +FROM python:3.7-alpine3.16 LABEL maintainer="sig-platform@spinnaker.io" ARG TARGETARCH @@ -9,13 +9,10 @@ ENV AWS_CLI_VERSION=1.18.18 RUN apk --no-cache add --update \ bash \ curl \ - openjdk11-jre \ + openjdk17-jre \ openssl \ - py-pip \ - python \ && pip install --upgrade awscli==${AWS_CLI_VERSION} \ && apk --purge del \ - py-pip \ && rm -rf /var/cache/apk RUN echo '#!/usr/bin/env bash' > /usr/local/bin/hal && \ diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 69be710006..91363b626a 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -9,7 +9,7 @@ ENV AWS_CLI_VERSION=1.18.18 RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y \ - openjdk-11-jre-headless \ + openjdk-17-jre-headless \ curl \ python-pip && \ rm -rf /var/lib/apt/lists/* && \ diff --git a/gradle.properties b/gradle.properties index 3f492aad94..9890d3ec9c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ fiatVersion=1.50.0 front50Version=2.35.0 org.gradle.parallel=true spinnakerGradleVersion=8.32.1 -targetJava11=true +targetJava17=false # To enable a composite reference to a project, set the # project property `'Composite=true'`.