From 8bcb237d5c5852e13bc3e4a4a474d99a7db4513f Mon Sep 17 00:00:00 2001 From: Lars Johansson Date: Tue, 9 Jan 2024 14:32:41 +0100 Subject: [PATCH] Update to Java 17 --- .github/workflows/java-build-and-test.yml | 6 +-- .travis.yml | 2 +- Dockerfile | 6 +-- Dockerfile.integrationtest | 4 +- README.md | 52 +++++++++++------------ pom.xml | 6 +-- 6 files changed, 36 insertions(+), 40 deletions(-) diff --git a/.github/workflows/java-build-and-test.yml b/.github/workflows/java-build-and-test.yml index 4406ce9..946fc03 100644 --- a/.github/workflows/java-build-and-test.yml +++ b/.github/workflows/java-build-and-test.yml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 11 + java-version: 17 - name: Build with Maven - run: mvn clean verify \ No newline at end of file + run: mvn clean verify diff --git a/.travis.yml b/.travis.yml index 4953b7a..29f93ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ sudo: required language: java jdk: - - openjdk11 + - openjdk17 services: - elasticsearch diff --git a/Dockerfile b/Dockerfile index 7046dbd..dbafecc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use Maven image to execute build. -FROM maven:3.6.3-openjdk-11 AS maven-build +FROM maven:3.6.3-openjdk-17 AS maven-build RUN mkdir phoebus-olog WORKDIR /phoebus-olog COPY . . @@ -10,9 +10,7 @@ RUN mvn clean install \ -Pdeployable-jar # Use smaller openjdk image for running. -FROM openjdk:11 -# apt clean is run automatically in debian-based images. -RUN apt update && apt install -y wait-for-it +FROM openjdk:17 # Run commands as user 'olog' RUN useradd -ms /bin/bash olog # Use previous maven-build image. diff --git a/Dockerfile.integrationtest b/Dockerfile.integrationtest index abfafe0..d031463 100644 --- a/Dockerfile.integrationtest +++ b/Dockerfile.integrationtest @@ -16,10 +16,8 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ------------------------------------------------------------------------------ -FROM openjdk:11 +FROM openjdk:17 -# apt clean is run automatically in debian-based images. -RUN apt update && apt install -y wait-for-it # Run commands as user 'olog' RUN useradd -ms /bin/bash olog diff --git a/README.md b/README.md index 9758dd0..44d4805 100644 --- a/README.md +++ b/README.md @@ -5,29 +5,29 @@ An online logbook service that allows for the creation and retrieval of log entr [Phoebus Olog Documentation](https://olog.readthedocs.io/) ### Installation -Olog +Olog * Prerequisites - * JDK 11 or newer + * JDK 17 or newer * Elastic version 8.2.x * mongo gridfs - **Download links for the prerequisites** - Download and install elasticsearch (verision 8.2.x) from [elastic.com](https://www.elastic.co/downloads/past-releases/elasticsearch-8-2-3) - Download and install mongodb from [mongodb](https://www.mongodb.com/download-center/community) - - + **Download links for the prerequisites** + Download and install elasticsearch (verision 8.2.x) from [elastic.com](https://www.elastic.co/downloads/past-releases/elasticsearch-8-2-3) + Download and install mongodb from [mongodb](https://www.mongodb.com/download-center/community) + + * Configure the service (optional) -The configuration files for olog-es are present under `phoebus-olog/tree/master/src/main/resources` +The configuration files for olog-es are present under `phoebus-olog/tree/master/src/main/resources` -* Build +* Build ``` cd phoebus-olog mvn clean install -``` +``` * Build deployable jar @@ -37,9 +37,9 @@ cd phoebus-olog mvn -Pdeployable-jar clean install ``` -#### Start the service +#### Start the service -Using spring boot +Using spring boot ``` mvn org.springframework.boot:spring-boot-maven-plugin:run @@ -47,7 +47,7 @@ mvn org.springframework.boot:spring-boot-maven-plugin:run #### Check if service is running -Once the service is running, the service consists of a welcome page `http://localhost:8080/Olog` +Once the service is running, the service consists of a welcome page `http://localhost:8080/Olog` which will provide information about the version of the Olog service running, along with information about the version and connection status of the elastic and mongo backends. @@ -107,33 +107,33 @@ Create a sonatype account and update the maven settings.xml file with your sonat ``` -**Prepare the release** -`mvn release:prepare` +**Prepare the release** +`mvn release:prepare` In this step will ensure there are no uncommitted changes, ensure the versions number are correct, tag the scm, etc.. A full list of checks is documented [here](https://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html): -**Perform the release** -`mvn release:perform` +**Perform the release** +`mvn release:perform` Checkout the release tag, build, sign and push the build binaries to sonatype. **NOTE:** Mac OS users should invoke `export GPG_TTY=$(tty)` prior to `mvn release:perform`. -**Publish** +**Publish** Open the staging repository in [sonatype](https://s01.oss.sonatype.org/#stagingRepositories) and hit the *publish* button ### Releasing Docker Images Docker images are published to the GitHub Container Registry via GitHub actions. This is triggered by: - push to master - + Images are published to the `ghcr.io//-` registry under the following tags: - `latest` - `` - `-` -This tag information is extracted from the Maven POM (via the `help` plugin). In order to avoid defining all of this -in the GitHub actions themselves, the generation of these tag names is delegated to shell scripts in the `scripts` folder. +This tag information is extracted from the Maven POM (via the `help` plugin). In order to avoid defining all of this +in the GitHub actions themselves, the generation of these tag names is delegated to shell scripts in the `scripts` folder. -If you need to debug issues related to registry/tag names outside of GitHub's CI/CD environment, +If you need to debug issues related to registry/tag names outside of GitHub's CI/CD environment, you can run these scripts locally: ``` @@ -143,8 +143,8 @@ source ./scripts/setup-locally.sh # Build the tag names from Maven etc and write them to PROJECT_INFO.txt ./scripts/write-project-info.sh -# Append the vars in PROJECT_INFO.txt to the GitHub environment file -# (setup-locally.sh uses THE_GITHUB_ENV_FILE.txt, but in GH CI/CD +# Append the vars in PROJECT_INFO.txt to the GitHub environment file +# (setup-locally.sh uses THE_GITHUB_ENV_FILE.txt, but in GH CI/CD # it is unique per run) # This file should match PROJECT_INFO.txt ./scripts/set-github-env.sh @@ -154,5 +154,5 @@ What you should see is: - registry and tag names are valid; e.g. are all lowercase and use dashes instead of spaces - registry and tag names should not be null/empty/unrelated to this project -If you would like to read up more on how passing environment variables between steps in a GitHub action works, -please see their docs on [Job Outputs](https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs). +If you would like to read up more on how passing environment variables between steps in a GitHub action works, +please see their docs on [Job Outputs](https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs). diff --git a/pom.xml b/pom.xml index 415af56..3fdf684 100644 --- a/pom.xml +++ b/pom.xml @@ -271,8 +271,8 @@ maven-compiler-plugin 2.3.2 - 11 - 11 + 17 + 17 ${project.build.sourceEncoding} @@ -405,7 +405,7 @@ none - 11 + 17