Skip to content

Commit

Permalink
Jenkins build - switch to Open JDK 11 (#1112)
Browse files Browse the repository at this point in the history
Default JDK for build and tests is Open JDK 11 instead of previous Oracle JDK 8.0.
Maven is switched to latest version 3.6.3.
This change is related with implementation/activation Java Module System JPMS  in PR #1093.
There is also notification system enabled in the Jenkins pipeline to send a mail on unsuccessful and fixed builds and some minor release scripts changes.

Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
  • Loading branch information
rfelcman committed May 5, 2021
1 parent 436f5ff commit 7a3ea77
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 26 deletions.
19 changes: 19 additions & 0 deletions etc/jenkins/build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ spec:
"""
}
}
tools {
maven 'apache-maven-latest'
jdk 'openjdk-jdk11-latest'
}
stages {
// Initialize build environment
stage('Init') {
Expand Down Expand Up @@ -212,4 +216,19 @@ spec:
}
}
}
post {
// Send a mail on unsuccessful and fixed builds
unsuccessful { // means unstable || failure || aborted
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER failed!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [culprits(), requestor()],
to: '${NOTIFICATION_ADDRESS}'
}
fixed { // back to normal
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER is back to normal!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [culprits(), requestor()],
to: '${NOTIFICATION_ADDRESS}'
}
}
}
3 changes: 1 addition & 2 deletions etc/jenkins/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -13,5 +13,4 @@
# N/A

echo '-[ EclipseLink Build ]-----------------------------------------------------------'
. /etc/profile
mvn install -DskipTests -Poss-release
3 changes: 1 addition & 2 deletions etc/jenkins/publish_snapshots.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -16,7 +16,6 @@ if [ ${CONTINUOUS_BUILD} = "true" ]; then
echo '-[ EclipseLink Publish to Jakarta Snapshots -> No publishing any artifacts]-----------------------------------------------------------'
else
echo '-[ EclipseLink Publish to Jakarta Snapshots ]-----------------------------------------------------------'
. /etc/profile
mvn --no-transfer-progress -U -C -B -V \
-Psnapshots -DskipTests \
-Ddoclint=none -Ddeploy \
Expand Down
19 changes: 19 additions & 0 deletions etc/jenkins/release.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ spec:
"""
}
}
tools {
maven 'apache-maven-latest'
jdk 'openjdk-jdk11-latest'
}
stages {

// Prepare and promote EclipseLink artifacts to oss.sonatype.org (staging) and to the Eclipse.org Milestone Builds area
Expand Down Expand Up @@ -140,4 +144,19 @@ spec:
}
}
}
post {
// Send a mail on unsuccessful and fixed builds
unsuccessful { // means unstable || failure || aborted
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER failed!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [culprits(), requestor()],
to: '${NOTIFICATION_ADDRESS}'
}
fixed { // back to normal
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER is back to normal!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [culprits(), requestor()],
to: '${NOTIFICATION_ADDRESS}'
}
}
}
17 changes: 10 additions & 7 deletions etc/jenkins/release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -16,15 +16,16 @@ HELP_PLUGIN='org.apache.maven.plugins:maven-help-plugin:3.1.0'
# $1 - ECLIPSELINK_VERSION - Version to release
# $2 - NEXT_ECLIPSELINK_VERSION - Next snapshot version to set (e.g. 3.0.1-SNAPSHOT).
# $3 - DRY_RUN - Do not publish artifacts to OSSRH and code changes to GitHub.
# $4 - OVERWRITE - Allows to overwrite existing version in git and OSSRH staging repositories
# $4 - OVERWRITE_GIT - Allows to overwrite existing version in git
# $5 - OVERWRITE_STAGING - Allows to overwrite existing version in OSSRH (Jakarta) staging repositories

echo '-[ EclipseLink Release ]-----------------------------------------------------------'
. /etc/profile

ECLIPSELINK_VERSION="${1}"
NEXT_ECLIPSELINK_VERSION="${2}"
DRY_RUN="${3}"
OVERWRITE="${4}"
OVERWRITE_GIT="${4}"
OVERWRITE_STAGING="${5}"


export MAVEN_SKIP_RC="true"
Expand Down Expand Up @@ -52,7 +53,7 @@ else
GIT_ORIGIN=`git remote`
echo '-[ Prepare branch ]-------------------------------------------------------------'
if [[ -n `git branch -r | grep "${GIT_ORIGIN}/${RELEASE_BRANCH}"` ]]; then
if [ "${OVERWRITE}" = 'true' ]; then
if [ "${OVERWRITE_GIT}" = 'true' ]; then
echo "${GIT_ORIGIN}/${RELEASE_BRANCH} branch already exists, deleting"
git push --delete origin "${RELEASE_BRANCH}" && true
else
Expand All @@ -62,7 +63,7 @@ else
fi
echo '-[ Release tag cleanup ]--------------------------------------------------------'
if [[ -n `git ls-remote --tags ${GIT_ORIGIN} | grep "${RELEASE_TAG}"` ]]; then
if [ "${OVERWRITE}" = 'true' ]; then
if [ "${OVERWRITE_GIT}" = 'true' ]; then
echo "${RELEASE_TAG} tag already exists, deleting"
git push --delete origin "${RELEASE_TAG}" && true
else
Expand Down Expand Up @@ -90,7 +91,9 @@ ECLIPSELINK_STAGING_KEY=$(echo ${ECLIPSELINK_STAGING_DESC} | sed -e 's/\./\\\./g
echo '-[ EclipseLink release version ]--------------------------------------------------------'
set_version 'ECLIPSELINK' "${ECLIPSELINK_DIR}" "${ECLIPSELINK_RELEASE_VERSION}" "${ECLIPSELINK_GROUP_ID}" "${ECLIPSELINK_ARTIFACT_ID}" ''

drop_artifacts "${ECLIPSELINK_STAGING_KEY}" "${ECLIPSELINK_DIR}"
if [ "${OVERWRITE_STAGING}" = 'true' ]; then
drop_artifacts "${ECLIPSELINK_STAGING_KEY}" "${ECLIPSELINK_DIR}"
fi

echo '-[ Build project mvn clean install ]-----------------------------'
#This step is needed to populate local Maven repository with required but not deployed artifacts
Expand Down
21 changes: 12 additions & 9 deletions etc/jenkins/release_asm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@

#
# Arguments:
# $1 - ASM_VERSION
# $2 - NEXT_ASM_VERSION
# $3 - DRY_RUN
# $4 - OVERWRITE
# $1 - ASM_VERSION - Version to release
# $2 - NEXT_ASM_VERSION - Next snapshot version to set (e.g. 3.0.1-SNAPSHOT).
# $3 - DRY_RUN - Do not publish artifacts to OSSRH and code changes to GitHub.
# $4 - OVERWRITE_GIT - Allows to overwrite existing version in git
# $5 - OVERWRITE_STAGING - Allows to overwrite existing version in OSSRH (Jakarta) staging repositories


ASM_VERSION="${1}"
NEXT_ASM_VERSION="${2}"
DRY_RUN="${3}"
OVERWRITE="${4}"
OVERWRITE_GIT="${4}"
OVERWRITE_STAGING="${5}"


export MAVEN_SKIP_RC="true"
Expand All @@ -50,7 +53,7 @@ else
GIT_ORIGIN=`git remote`
echo '-[ Prepare branch ]-------------------------------------------------------------'
if [[ -n `git branch -r | grep "${GIT_ORIGIN}/${RELEASE_BRANCH}"` ]]; then
if [ "${OVERWRITE}" = 'true' ]; then
if [ "${OVERWRITE_GIT}" = 'true' ]; then
echo "${GIT_ORIGIN}/${RELEASE_BRANCH} branch already exists, deleting"
git push --delete origin "${RELEASE_BRANCH}" && true
else
Expand All @@ -60,7 +63,7 @@ else
fi
echo '-[ Release tag cleanup ]--------------------------------------------------------'
if [[ -n `git ls-remote --tags ${GIT_ORIGIN} | grep "${RELEASE_TAG}"` ]]; then
if [ "${OVERWRITE}" = 'true' ]; then
if [ "${OVERWRITE_GIT}" = 'true' ]; then
echo "${RELEASE_TAG} tag already exists, deleting"
git push --delete origin "${RELEASE_TAG}" && true
else
Expand Down Expand Up @@ -88,8 +91,8 @@ ASM_STAGING_KEY=$(echo ${ASM_STAGING_DESC} | sed -e 's/\./\\\./g')
echo '-[ EclipseLink ASM release version ]--------------------------------------------------------'
set_version 'ASM' "${ASM_DIR}" "${ASM_RELEASE_VERSION}" "${ASM_GROUP_ID}" "${ASM_ARTIFACT_ID}" ''

if [ "${OVERWRITE}" = 'true' ]; then
drop_artifacts "${ASM_STAGING_KEY}" "${ASM_DIR}"
if [ "${OVERWRITE_STAGING}" = 'true' ]; then
drop_artifacts "${ECLIPSELINK_STAGING_KEY}" "${ECLIPSELINK_DIR}"
fi

echo '-[ Deploy artifacts to staging repository ]-----------------------------'
Expand Down
3 changes: 1 addition & 2 deletions etc/jenkins/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -13,7 +13,6 @@
# N/A

echo '-[ EclipseLink Tests LRG ]-----------------------------------------------------------'
. /etc/profile

if [ ${CONTINUOUS_BUILD} = "true" ]; then
echo '-[ EclipseLink SRG Tests ]-----------------------------------------------------------'
Expand Down
3 changes: 1 addition & 2 deletions etc/jenkins/test_nosql.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -13,7 +13,6 @@
# N/A

echo '-[ EclipseLink Test NoSQL ]-----------------------------------------------------------'
. /etc/profile
/opt/bin/mongo-start.sh
mvn verify -pl :org.eclipse.persistence.nosql -P mongodb
/opt/bin/mongo-stop.sh
3 changes: 1 addition & 2 deletions etc/jenkins/test_server.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -16,7 +16,6 @@ if [ ${CONTINUOUS_BUILD} = "true" ]; then
echo '-[ EclipseLink Continuous Build -> No server tests]-------------------------------'
else
echo '-[ EclipseLink Test Server ]-----------------------------------------------------------'
. /etc/profile
echo '-[ INFO Server tests are temporary disabled until server with Jakarta packages will be available]-'
# /opt/bin/mysql-start.sh
# mvn --batch-mode verify -pl :org.eclipse.persistence.jpa.test -P server-test-jpa-lrg1,mysql
Expand Down

0 comments on commit 7a3ea77

Please sign in to comment.