From e1d8f8f8f4742d93106535f5e79cf083ee81fd86 Mon Sep 17 00:00:00 2001 From: Guillaume Renard Date: Thu, 19 Sep 2024 09:05:11 +0200 Subject: [PATCH 1/5] NXP-32774: Update to Jakarta --- .../events/PreventColdStorageUpdateListener.java | 2 +- .../coldstorage/service/ColdStorageServiceImpl.java | 8 ++++---- .../io/IsSharedMainContentJsonEnricherTest.java | 2 +- .../operations/AbstractTestColdStorageOperation.java | 2 +- .../coldstorage/operations/MoveToColdStorageTest.java | 9 +++++---- .../operations/RequestRetrievalFromColdStorageTest.java | 7 ++++--- .../operations/RestoreFromColdStorageTest.java | 4 ++-- .../coldstorage/operations/TestColdStorageRendition.java | 4 ++-- .../service/AbstractTestColdStorageService.java | 6 +++--- .../coldstorage/service/TestDummyColdStorageService.java | 2 +- 10 files changed, 24 insertions(+), 22 deletions(-) diff --git a/nuxeo-coldstorage/src/main/java/org/nuxeo/coldstorage/events/PreventColdStorageUpdateListener.java b/nuxeo-coldstorage/src/main/java/org/nuxeo/coldstorage/events/PreventColdStorageUpdateListener.java index dda3095a..2edefe3c 100644 --- a/nuxeo-coldstorage/src/main/java/org/nuxeo/coldstorage/events/PreventColdStorageUpdateListener.java +++ b/nuxeo-coldstorage/src/main/java/org/nuxeo/coldstorage/events/PreventColdStorageUpdateListener.java @@ -19,7 +19,7 @@ package org.nuxeo.coldstorage.events; -import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN; +import static jakarta.servlet.http.HttpServletResponse.SC_FORBIDDEN; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/nuxeo-coldstorage/src/main/java/org/nuxeo/coldstorage/service/ColdStorageServiceImpl.java b/nuxeo-coldstorage/src/main/java/org/nuxeo/coldstorage/service/ColdStorageServiceImpl.java index 8e227471..14ac2d4c 100644 --- a/nuxeo-coldstorage/src/main/java/org/nuxeo/coldstorage/service/ColdStorageServiceImpl.java +++ b/nuxeo-coldstorage/src/main/java/org/nuxeo/coldstorage/service/ColdStorageServiceImpl.java @@ -21,10 +21,10 @@ package org.nuxeo.coldstorage.service; -import static javax.servlet.http.HttpServletResponse.SC_CONFLICT; -import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN; -import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; -import static javax.servlet.http.HttpServletResponse.SC_PRECONDITION_FAILED; +import static jakarta.servlet.http.HttpServletResponse.SC_CONFLICT; +import static jakarta.servlet.http.HttpServletResponse.SC_FORBIDDEN; +import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND; +import static jakarta.servlet.http.HttpServletResponse.SC_PRECONDITION_FAILED; import static org.nuxeo.coldstorage.ColdStorageConstants.COLD_STORAGE_BEING_RETRIEVED_PROPERTY; import static org.nuxeo.coldstorage.ColdStorageConstants.COLD_STORAGE_CONTENT_ARCHIVE_LOCATION_MAIL_TEMPLATE_KEY; import static org.nuxeo.coldstorage.ColdStorageConstants.COLD_STORAGE_CONTENT_AVAILABLE_EVENT_NAME; diff --git a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/io/IsSharedMainContentJsonEnricherTest.java b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/io/IsSharedMainContentJsonEnricherTest.java index f62e7f70..ef67bcfe 100644 --- a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/io/IsSharedMainContentJsonEnricherTest.java +++ b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/io/IsSharedMainContentJsonEnricherTest.java @@ -21,7 +21,7 @@ import java.io.Serializable; import java.util.List; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/AbstractTestColdStorageOperation.java b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/AbstractTestColdStorageOperation.java index 983ad505..77c90983 100644 --- a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/AbstractTestColdStorageOperation.java +++ b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/AbstractTestColdStorageOperation.java @@ -29,7 +29,7 @@ import java.util.UUID; import java.util.stream.Collectors; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.junit.runner.RunWith; import org.nuxeo.coldstorage.ColdStorageConstants; diff --git a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/MoveToColdStorageTest.java b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/MoveToColdStorageTest.java index 4ea0777a..fa48d59a 100644 --- a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/MoveToColdStorageTest.java +++ b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/MoveToColdStorageTest.java @@ -21,9 +21,9 @@ package org.nuxeo.coldstorage.operations; -import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN; -import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; -import static javax.servlet.http.HttpServletResponse.SC_PRECONDITION_FAILED; +import static jakarta.servlet.http.HttpServletResponse.SC_FORBIDDEN; +import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND; +import static jakarta.servlet.http.HttpServletResponse.SC_PRECONDITION_FAILED; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; @@ -37,7 +37,7 @@ import java.util.List; import java.util.UUID; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.junit.Test; import org.nuxeo.coldstorage.ColdStorageConstants; @@ -65,6 +65,7 @@ */ @Features(DummyColdStorageFeature.class) public class MoveToColdStorageTest extends AbstractTestColdStorageOperation { + @Inject protected CoreSession session; diff --git a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/RequestRetrievalFromColdStorageTest.java b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/RequestRetrievalFromColdStorageTest.java index c48827d2..d71374aa 100644 --- a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/RequestRetrievalFromColdStorageTest.java +++ b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/RequestRetrievalFromColdStorageTest.java @@ -19,8 +19,8 @@ package org.nuxeo.coldstorage.operations; -import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN; -import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; +import static jakarta.servlet.http.HttpServletResponse.SC_FORBIDDEN; +import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -31,9 +31,10 @@ import java.util.List; import java.util.Map; -import javax.inject.Inject; import javax.security.auth.login.LoginException; +import jakarta.inject.Inject; + import org.junit.Test; import org.nuxeo.coldstorage.ColdStorageConstants; import org.nuxeo.coldstorage.DummyColdStorageFeature; diff --git a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/RestoreFromColdStorageTest.java b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/RestoreFromColdStorageTest.java index 5185e5c2..e945d450 100644 --- a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/RestoreFromColdStorageTest.java +++ b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/RestoreFromColdStorageTest.java @@ -19,7 +19,7 @@ package org.nuxeo.coldstorage.operations; -import static javax.servlet.http.HttpServletResponse.SC_CONFLICT; +import static jakarta.servlet.http.HttpServletResponse.SC_CONFLICT; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -30,7 +30,7 @@ import java.io.IOException; import java.util.List; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.junit.Test; import org.nuxeo.coldstorage.ColdStorageConstants; diff --git a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/TestColdStorageRendition.java b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/TestColdStorageRendition.java index ed013492..857929f8 100644 --- a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/TestColdStorageRendition.java +++ b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/operations/TestColdStorageRendition.java @@ -19,7 +19,7 @@ package org.nuxeo.coldstorage.operations; -import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; +import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; @@ -30,7 +30,7 @@ import java.util.List; import java.util.stream.Collectors; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.junit.Test; import org.nuxeo.coldstorage.ColdStorageConstants; diff --git a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/service/AbstractTestColdStorageService.java b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/service/AbstractTestColdStorageService.java index b7012d7e..26555a29 100644 --- a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/service/AbstractTestColdStorageService.java +++ b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/service/AbstractTestColdStorageService.java @@ -19,8 +19,8 @@ package org.nuxeo.coldstorage.service; -import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN; -import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; +import static jakarta.servlet.http.HttpServletResponse.SC_FORBIDDEN; +import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -46,7 +46,7 @@ import java.util.List; import java.util.Map; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.apache.commons.collections.CollectionUtils; import org.junit.Test; diff --git a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/service/TestDummyColdStorageService.java b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/service/TestDummyColdStorageService.java index 7df4aa2a..6736c982 100644 --- a/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/service/TestDummyColdStorageService.java +++ b/nuxeo-coldstorage/src/test/java/org/nuxeo/coldstorage/service/TestDummyColdStorageService.java @@ -52,7 +52,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.apache.commons.lang3.time.DateUtils; import org.apache.logging.log4j.Level; From 13c347d2fe340208f7819ba6e037b84297b6cf1e Mon Sep 17 00:00:00 2001 From: Guillaume Renard Date: Thu, 19 Sep 2024 09:08:02 +0200 Subject: [PATCH 2/5] NXP-32774: Align on lts-2025 --- .github/workflows/crowdin.yml | 2 +- README.md | 4 ++-- ci/Jenkinsfiles/build.groovy | 2 +- ci/Jenkinsfiles/release.groovy | 4 ++-- ci/docker/Dockerfile | 2 +- nuxeo-coldstorage-package/pom.xml | 2 +- nuxeo-coldstorage-web/pom.xml | 2 +- nuxeo-coldstorage/pom.xml | 2 +- pom.xml | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index d9443341..74deb3ec 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -9,7 +9,7 @@ on: # Sync when a commit is done on the reference branches push: - branches: ["lts-2023"] + branches: ["lts-2025"] paths: - 'nuxeo-coldstorage-web/i18n/messages.json' diff --git a/README.md b/README.md index f5748360..8208609b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://jenkins.platform.dev.nuxeo.com/buildStatus/icon?job=coldstorage%2Fnuxeo-coldstorage%2Flts-2023)](https://jenkins.platform.dev.nuxeo.com/job/coldstorage/job/nuxeo-coldstorage/job/lts-2023/) +[![Build Status](https://jenkins.platform.dev.nuxeo.com/buildStatus/icon?job=coldstorage%2Fnuxeo-coldstorage%2Flts-2025)](https://jenkins.platform.dev.nuxeo.com/job/coldstorage/job/nuxeo-coldstorage/job/lts-2025/) # Nuxeo Cold Storage @@ -160,7 +160,7 @@ Continuous Integration & Continuous Deployment(and Delivery) are an important pa Nuxeo Cold Storage integrates [Jenkins pipelines](https://jenkins.platform.dev.nuxeo.com/job/coldstorage/job/nuxeo-coldstorage/) for each maintenance branch, for _LTS_ (fast track) and also for each opened PR. The following features are available: -- Each PR merge to _10.10_/_lts-2021_/_lts-2023_ branches will generate a "release candidate" package +- Each PR merge to _10.10_/_lts-2021_/_lts-2023_/_lts-2025_ branches will generate a "release candidate" package ### Localization Management diff --git a/ci/Jenkinsfiles/build.groovy b/ci/Jenkinsfiles/build.groovy index 2cda1462..12b54792 100644 --- a/ci/Jenkinsfiles/build.groovy +++ b/ci/Jenkinsfiles/build.groovy @@ -54,7 +54,7 @@ Closure buildUnitTestStage(env) { pipeline { agent { - label 'jenkins-nuxeo-package-lts-2023-nodejs18' + label 'jenkins-nuxeo-package-lts-2025' } options { buildDiscarder(logRotator(daysToKeepStr: '60', numToKeepStr: '60', artifactNumToKeepStr: '5')) diff --git a/ci/Jenkinsfiles/release.groovy b/ci/Jenkinsfiles/release.groovy index 851190fa..8468f318 100644 --- a/ci/Jenkinsfiles/release.groovy +++ b/ci/Jenkinsfiles/release.groovy @@ -23,7 +23,7 @@ library identifier: "platform-ci-shared-library@v0.0.39" pipeline { agent { - label 'jenkins-nuxeo-package-lts-2023-nodejs18' + label 'jenkins-nuxeo-package-lts-2025' } options { buildDiscarder(logRotator(daysToKeepStr: '60', numToKeepStr: '60', artifactNumToKeepStr: '5')) @@ -33,7 +33,7 @@ pipeline { environment { BRANCH_NAME = "${params.BRANCH}" BUILD_VERSION = "${params.BUILD_VERSION}" - JIRA_NUXEO_ADDON_MOVING_VERSION = 'coldstorage-2023.x' + JIRA_NUXEO_ADDON_MOVING_VERSION = 'coldstorage-2025.x' VERSION = "${nxUtils.getMajorDotMinorVersion(version: env.BUILD_VERSION)}" } stages { diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index da320e60..8c6125da 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -1,4 +1,4 @@ -ARG NUXEO_VERSION=2023 +ARG NUXEO_VERSION=2025 FROM docker-private.packages.nuxeo.com/nuxeo/nuxeo:${NUXEO_VERSION} diff --git a/nuxeo-coldstorage-package/pom.xml b/nuxeo-coldstorage-package/pom.xml index fca7630b..e989c2e2 100644 --- a/nuxeo-coldstorage-package/pom.xml +++ b/nuxeo-coldstorage-package/pom.xml @@ -4,7 +4,7 @@ org.nuxeo.coldstorage nuxeo-coldstorage-parent - 2023.4-SNAPSHOT + 2025.0-SNAPSHOT nuxeo-coldstorage-package diff --git a/nuxeo-coldstorage-web/pom.xml b/nuxeo-coldstorage-web/pom.xml index a537fae1..78b29413 100644 --- a/nuxeo-coldstorage-web/pom.xml +++ b/nuxeo-coldstorage-web/pom.xml @@ -3,7 +3,7 @@ org.nuxeo.coldstorage nuxeo-coldstorage-parent - 2023.4-SNAPSHOT + 2025.0-SNAPSHOT nuxeo-coldstorage-web Nuxeo Cold Storage WebUI integration diff --git a/nuxeo-coldstorage/pom.xml b/nuxeo-coldstorage/pom.xml index 4479f08a..44166097 100644 --- a/nuxeo-coldstorage/pom.xml +++ b/nuxeo-coldstorage/pom.xml @@ -4,7 +4,7 @@ org.nuxeo.coldstorage nuxeo-coldstorage-parent - 2023.4-SNAPSHOT + 2025.0-SNAPSHOT org.nuxeo.coldstorage diff --git a/pom.xml b/pom.xml index 1eccc179..d109a555 100644 --- a/pom.xml +++ b/pom.xml @@ -4,13 +4,13 @@ org.nuxeo nuxeo-parent - 2023.14 + 2025.0-SNAPSHOT org.nuxeo.coldstorage nuxeo-coldstorage-parent Nuxeo Cold Storage Parent - 2023.4-SNAPSHOT + 2025.0-SNAPSHOT pom Nuxeo Cold Storage allows the cold storage of document content. This can be needed for archiving, compliance, etc. From 1b6b40af6234fc627a23d8ddfa970e1d0d1f60f9 Mon Sep 17 00:00:00 2001 From: Guillaume Renard Date: Thu, 19 Sep 2024 09:10:38 +0200 Subject: [PATCH 3/5] NXP-32774: Add spotless formatting check --- ci/Jenkinsfiles/build.groovy | 60 +++++++++++++++++++++++++++--------- pom.xml | 15 +++++++++ 2 files changed, 60 insertions(+), 15 deletions(-) diff --git a/ci/Jenkinsfiles/build.groovy b/ci/Jenkinsfiles/build.groovy index 12b54792..4b7cebe6 100644 --- a/ci/Jenkinsfiles/build.groovy +++ b/ci/Jenkinsfiles/build.groovy @@ -90,23 +90,53 @@ pipeline { } } } - stage('Compile') { - steps { - container('maven') { - nxWithGitHubStatus(context: 'compile') { - echo """ - ---------------------------------------- - Compile - ----------------------------------------""" - echo "MAVEN_OPTS=$MAVEN_OPTS" - sh 'mvn -B -nsu -T4C install -DskipTests' + stage('Build') { + parallel { + stage('Compile') { + steps { + container('maven') { + nxWithGitHubStatus(context: 'compile') { + echo """ + ---------------------------------------- + Compile + ----------------------------------------""" + echo "MAVEN_OPTS=$MAVEN_OPTS" + sh 'mvn -B -nsu -T4C install -DskipTests' + } + } + } + post { + always { + archiveArtifacts artifacts: '**/target/*.jar, **/target/nuxeo-*-package-*.zip' + junit testResults: '**/target/surefire-reports/*.xml, **/target/failsafe-reports/*.xml', allowEmptyResults: true + } } } - } - post { - always { - archiveArtifacts artifacts: '**/target/*.jar, **/target/nuxeo-*-package-*.zip' - junit testResults: '**/target/surefire-reports/*.xml, **/target/failsafe-reports/*.xml', allowEmptyResults: true + stage('Formatting check') { + when { + // if current version is higher than default branch (aka: version in maintenance) run formatting check + expression { nxGitHub.getReferenceBranch().compareToIgnoreCase(nxGitHub.getDefaultBranch()) > 0 } + } + environment { + // env variable defined to workaround https://github.com/diffplug/spotless/pull/2238 + MAVEN_CLI_ARGS = "--settings /root/.m2/settings.xml -Duser.home=/home/jenkins -B -nsu" + } + steps { + container('maven') { + warnError(message: 'Formatting check has failed') { + nxWithGitHubStatus(context: 'maven/lint', message: 'Lint') { + script { + echo """ + ---------------------------------------- + Check formatting + ----------------------------------------""" + sh "git fetch origin lts-2025:origin/lts-2025" + sh "mvn ${MAVEN_CLI_ARGS} -V -Dcustom.environment=spotless spotless:check" + } + } + } + } + } } } } diff --git a/pom.xml b/pom.xml index d109a555..a3e21e87 100644 --- a/pom.xml +++ b/pom.xml @@ -83,6 +83,21 @@ + + + + + com.diffplug.spotless + spotless-maven-plugin + 2.43.0 + + origin/lts-2025 + + + + + + scm:git:git://github.com/nuxeo/nuxeo-coldstorage.git scm:git:ssh://git@github.com:nuxeo/nuxeo-coldstorage.git From f48735e9cc27b52706be8a12e949557dce8863da Mon Sep 17 00:00:00 2001 From: Guillaume Renard Date: Thu, 19 Sep 2024 09:12:02 +0200 Subject: [PATCH 4/5] Tmp Revert "NXP-32774: Add spotless formatting check" This reverts commit 1b6b40af6234fc627a23d8ddfa970e1d0d1f60f9. --- ci/Jenkinsfiles/build.groovy | 60 +++++++++--------------------------- pom.xml | 15 --------- 2 files changed, 15 insertions(+), 60 deletions(-) diff --git a/ci/Jenkinsfiles/build.groovy b/ci/Jenkinsfiles/build.groovy index 4b7cebe6..12b54792 100644 --- a/ci/Jenkinsfiles/build.groovy +++ b/ci/Jenkinsfiles/build.groovy @@ -90,53 +90,23 @@ pipeline { } } } - stage('Build') { - parallel { - stage('Compile') { - steps { - container('maven') { - nxWithGitHubStatus(context: 'compile') { - echo """ - ---------------------------------------- - Compile - ----------------------------------------""" - echo "MAVEN_OPTS=$MAVEN_OPTS" - sh 'mvn -B -nsu -T4C install -DskipTests' - } - } - } - post { - always { - archiveArtifacts artifacts: '**/target/*.jar, **/target/nuxeo-*-package-*.zip' - junit testResults: '**/target/surefire-reports/*.xml, **/target/failsafe-reports/*.xml', allowEmptyResults: true - } + stage('Compile') { + steps { + container('maven') { + nxWithGitHubStatus(context: 'compile') { + echo """ + ---------------------------------------- + Compile + ----------------------------------------""" + echo "MAVEN_OPTS=$MAVEN_OPTS" + sh 'mvn -B -nsu -T4C install -DskipTests' } } - stage('Formatting check') { - when { - // if current version is higher than default branch (aka: version in maintenance) run formatting check - expression { nxGitHub.getReferenceBranch().compareToIgnoreCase(nxGitHub.getDefaultBranch()) > 0 } - } - environment { - // env variable defined to workaround https://github.com/diffplug/spotless/pull/2238 - MAVEN_CLI_ARGS = "--settings /root/.m2/settings.xml -Duser.home=/home/jenkins -B -nsu" - } - steps { - container('maven') { - warnError(message: 'Formatting check has failed') { - nxWithGitHubStatus(context: 'maven/lint', message: 'Lint') { - script { - echo """ - ---------------------------------------- - Check formatting - ----------------------------------------""" - sh "git fetch origin lts-2025:origin/lts-2025" - sh "mvn ${MAVEN_CLI_ARGS} -V -Dcustom.environment=spotless spotless:check" - } - } - } - } - } + } + post { + always { + archiveArtifacts artifacts: '**/target/*.jar, **/target/nuxeo-*-package-*.zip' + junit testResults: '**/target/surefire-reports/*.xml, **/target/failsafe-reports/*.xml', allowEmptyResults: true } } } diff --git a/pom.xml b/pom.xml index a3e21e87..d109a555 100644 --- a/pom.xml +++ b/pom.xml @@ -83,21 +83,6 @@ - - - - - com.diffplug.spotless - spotless-maven-plugin - 2.43.0 - - origin/lts-2025 - - - - - - scm:git:git://github.com/nuxeo/nuxeo-coldstorage.git scm:git:ssh://git@github.com:nuxeo/nuxeo-coldstorage.git From 7767bdc8f828b6bb55092290dd9868cdb9d0c63f Mon Sep 17 00:00:00 2001 From: Guillaume Renard Date: Thu, 26 Sep 2024 12:45:29 +0200 Subject: [PATCH 5/5] NXP-32774: Upgrade skaffold to install ffmpeg from nuxeo private repo --- ci/Jenkinsfiles/build.groovy | 5 ++++- ci/docker/Dockerfile | 7 ++----- ci/docker/nuxeo-private.repo | 9 +++++++++ ci/docker/skaffold.yaml | 37 ++++++++++-------------------------- 4 files changed, 25 insertions(+), 33 deletions(-) create mode 100644 ci/docker/nuxeo-private.repo diff --git a/ci/Jenkinsfiles/build.groovy b/ci/Jenkinsfiles/build.groovy index 12b54792..423e1fba 100644 --- a/ci/Jenkinsfiles/build.groovy +++ b/ci/Jenkinsfiles/build.groovy @@ -160,7 +160,10 @@ pipeline { sh "mkdir -p ci/docker/target && cp ${NUXEO_COLDSTORAGE_PACKAGE_PATH} ci/docker/target" def nuxeoVersion = sh(returnStdout: true, script: 'mvn org.apache.maven.plugins:maven-help-plugin:3.3.0:evaluate -Dexpression=nuxeo.platform.version -q -DforceStdout') - nxDocker.build(skaffoldFile: 'ci/docker/skaffold.yaml', envVars: ["NUXEO_VERSION=${nuxeoVersion}"]) + withCredentials([usernamePassword(credentialsId: 'packages.nuxeo.com-auth', usernameVariable: 'YUM_REPO_USERNAME', passwordVariable: 'YUM_REPO_PASSWORD')]) { + sh 'envsubst < ci/docker/nuxeo-private.repo > ci/docker/nuxeo-private.repo~gen' + } + nxDocker.build(skaffoldFile: 'ci/docker/skaffold.yaml', envVars: ["NUXEO_VERSION=${nuxeoVersion}"]) } } nxWithGitHubStatus(context: 'ftests') { diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index 8c6125da..f02c2229 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -12,11 +12,8 @@ LABEL org.nuxeo.coldstorage.version=$VERSION USER root # install RPM Fusion free repository -RUN dnf -y localinstall --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm \ - # enable the Rocky Linux 9 - CRB repository which contains some ffmpeg libraries - && dnf config-manager --enable crb \ - # install ffmpeg package - && dnf -y install ffmpeg \ +RUN --mount=type=secret,id=nuxeo-private,target=/etc/yum.repos.d/nuxeo-private.repo \ + dnf -y install ffmpeg-nuxeo \ && dnf clean all USER 900 diff --git a/ci/docker/nuxeo-private.repo b/ci/docker/nuxeo-private.repo new file mode 100644 index 00000000..d118ddf8 --- /dev/null +++ b/ci/docker/nuxeo-private.repo @@ -0,0 +1,9 @@ +[nuxeo-private] +name=Nexus Private Yum Release Repository +baseurl=https://packages.nuxeo.com/repository/yum-registry/ +username=$YUM_REPO_USERNAME +password=$YUM_REPO_PASSWORD +enabled=1 +protect=0 +gpgcheck=0 +metadata_expire=30s \ No newline at end of file diff --git a/ci/docker/skaffold.yaml b/ci/docker/skaffold.yaml index 5100a1f1..5562810e 100644 --- a/ci/docker/skaffold.yaml +++ b/ci/docker/skaffold.yaml @@ -11,37 +11,20 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: skaffold/v2beta17 +apiVersion: skaffold/v2beta29 kind: Config build: tagPolicy: envTemplate: template: "{{.VERSION}}" artifacts: - - image: "$DOCKER_REGISTRY/nuxeo/nuxeo-coldstorage-ftests" + - image: "nuxeo/nuxeo-coldstorage-ftests" context: ci/docker - kaniko: - useNewRun: true - singleSnapshot: true - snapshot-mode: "time" - buildArgs: - NUXEO_VERSION: "{{.NUXEO_VERSION}}" - BUILD_TAG: "{{.BUILD_TAG}}" - SCM_REF: "{{.GIT_COMMIT}}" - VERSION: "{{.VERSION}}" - cluster: - namespace: platform - dockerConfig: - secretName: jenkins-docker-cfg - resources: - requests: - cpu: "1" - memory: "3Gi" - limits: - cpu: "2" - memory: "6Gi" - tolerations: - - key: team - operator: "Equal" - value: platform - effect: "NoSchedule" + custom: + buildCommand: | + docker-buildx \ + --build-arg NUXEO_VERSION={{.NUXEO_VERSION}} \ + --build-arg BUILD_TAG={{.BUILD_TAG}} \ + --build-arg GIT_COMMIT={{.GIT_COMMIT}} \ + --build-arg VERSION={{.VERSION}} \ + --secret id=nuxeo-private,src=nuxeo-private.repo~gen \