Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to java 17 #185

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .classpath

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/java-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: mvn clean verify
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
/build/
/target/
/.project
/.classpath

**/.idea
**/*iml

# The H2 database files
**/*mv.db
**/*trace.db

### Docker ###
docker-compose-local*

### Eclipse ###
.settings/org.eclipse.core.resources.prefs
.settings/org.eclipse.jdt.core.prefs
.settings/org.eclipse.m2e.core.prefs

pom.xml.releaseBackup

# Locally-generated CI/CD debugging files
PROJECT_INFO.txt
THE_GITHUB_ENV_FILE.txt
THE_GITHUB_ENV_FILE.txt
16 changes: 0 additions & 16 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: required
language: java

jdk:
- openjdk11
- openjdk17

services:
- elasticsearch
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 . .
Expand All @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile.integrationtest
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -37,17 +37,17 @@ 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
```

#### 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.
Expand Down Expand Up @@ -107,33 +107,33 @@ Create a sonatype account and update the maven settings.xml file with your sonat
</servers>
```

**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/<org name>/<group id>-<artifact id>` registry under the following tags:
- `latest`
- `<version>`
- `<version>-<timestamp>`

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:

```
Expand All @@ -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
Expand All @@ -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).
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>11</source>
<target>11</target>
<source>17</source>
<target>17</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
Expand Down Expand Up @@ -405,7 +405,7 @@
<configuration>
<!-- add this to disable checking -->
<doclint>none</doclint>
<source>11</source>
<source>17</source>
</configuration>
</execution>
</executions>
Expand Down