This is an automated email from the ASF dual-hosted git repository.
rantunes pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-pipelines.git
The following commit(s) were added to refs/heads/main by this push:
new ace25288 kie-issues#1214: Replace explicit references to quay.io
images across CI pipelines (#1207)
ace25288 is described below
commit ace252880ca370af0bbcec11b55e84fc0bd4fa8a
Author: Rodrigo Antunes <[email protected]>
AuthorDate: Thu Jun 20 09:23:41 2024 -0300
kie-issues#1214: Replace explicit references to quay.io images across CI
pipelines (#1207)
* CI updates for Apache 10 release
* Add new apache dockerhub credentials id
* Fix tests
* Replace image pr check
---
.ci/jenkins/Jenkinsfile.nightly.cloud | 3 ++-
.ci/jenkins/Jenkinsfile.release.cloud | 3 ++-
.ci/jenkins/Jenkinsfile.weekly.cloud | 3 ++-
.ci/jenkins/config/branch.yaml | 9 +++++----
.ci/jenkins/config/main.yaml | 2 +-
.ci/jenkins/dsl/jobs.groovy | 9 ++++++---
docs/jenkins.md | 12 ++++++------
dsl/scripts/pr_check.groovy | 2 +-
jenkins-pipeline-shared-libraries/test/vars/MavenSpec.groovy | 4 ++--
jenkins-pipeline-shared-libraries/vars/maven.groovy | 3 ++-
10 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/.ci/jenkins/Jenkinsfile.nightly.cloud
b/.ci/jenkins/Jenkinsfile.nightly.cloud
index f84d7e3a..9b60353f 100644
--- a/.ci/jenkins/Jenkinsfile.nightly.cloud
+++ b/.ci/jenkins/Jenkinsfile.nightly.cloud
@@ -200,7 +200,8 @@ void addAppsParam(buildParams) {
}
void addImageBuildParams(List buildParams, String tag, String paramsPrefix =
defaultImageParamsPrefix, String extraSuffix = '') {
- addStringParam(buildParams, constructKey(paramsPrefix,
'REGISTRY_CREDENTIALS'), env.IMAGE_REGISTRY_CREDENTIALS)
+ addStringParam(buildParams, constructKey(paramsPrefix,
'REGISTRY_USER_CREDENTIALS_ID'), env.IMAGE_REGISTRY_USER_CREDENTIALS_ID)
+ addStringParam(buildParams, constructKey(paramsPrefix,
'REGISTRY_TOKEN_CREDENTIALS_ID'), env.IMAGE_REGISTRY_TOKEN_CREDENTIALS_ID)
addStringParam(buildParams, constructKey(paramsPrefix, 'REGISTRY'),
env.IMAGE_REGISTRY)
addStringParam(buildParams, constructKey(paramsPrefix, 'NAMESPACE'),
env.IMAGE_NAMESPACE)
addStringParam(buildParams, constructKey(paramsPrefix, 'TAG'), tag)
diff --git a/.ci/jenkins/Jenkinsfile.release.cloud
b/.ci/jenkins/Jenkinsfile.release.cloud
index 78edcb0a..12d4f897 100644
--- a/.ci/jenkins/Jenkinsfile.release.cloud
+++ b/.ci/jenkins/Jenkinsfile.release.cloud
@@ -350,7 +350,8 @@ void addAppsParam(buildParams) {
void addImageBuildParams(List buildParams, String tag, boolean isFinalImage =
false, String paramsPrefix = defaultImageParamsPrefix) {
addBooleanParam(buildParams, constructKey(paramsPrefix,
'USE_OPENSHIFT_REGISTRY'), !isFinalImage && params.USE_TEMP_OPENSHIFT_REGISTRY)
- addStringParam(buildParams, constructKey(paramsPrefix,
'REGISTRY_CREDENTIALS'), env.IMAGE_REGISTRY_CREDENTIALS)
+ addStringParam(buildParams, constructKey(paramsPrefix,
'REGISTRY_USER_CREDENTIALS_ID'), env.IMAGE_REGISTRY_USER_CREDENTIALS_ID)
+ addStringParam(buildParams, constructKey(paramsPrefix,
'REGISTRY_TOKEN_CREDENTIALS_ID'), env.IMAGE_REGISTRY_TOKEN_CREDENTIALS_ID)
addStringParam(buildParams, constructKey(paramsPrefix, 'REGISTRY'),
env.IMAGE_REGISTRY)
addStringParam(buildParams, constructKey(paramsPrefix, 'NAMESPACE'),
env.IMAGE_NAMESPACE)
addStringParam(buildParams, constructKey(paramsPrefix, 'TAG'), tag)
diff --git a/.ci/jenkins/Jenkinsfile.weekly.cloud
b/.ci/jenkins/Jenkinsfile.weekly.cloud
index 58dcd581..cad5725c 100644
--- a/.ci/jenkins/Jenkinsfile.weekly.cloud
+++ b/.ci/jenkins/Jenkinsfile.weekly.cloud
@@ -202,7 +202,8 @@ void addExamplesParam(buildParams) {
}
void addImageBuildParams(List buildParams, String tag, String paramsPrefix =
defaultImageParamsPrefix, String extraSuffix = '') {
- addStringParam(buildParams, constructKey(paramsPrefix,
'REGISTRY_CREDENTIALS'), env.IMAGE_REGISTRY_CREDENTIALS)
+ addStringParam(buildParams, constructKey(paramsPrefix,
'REGISTRY_USER_CREDENTIALS_ID'), env.IMAGE_REGISTRY_USER_CREDENTIALS_ID)
+ addStringParam(buildParams, constructKey(paramsPrefix,
'REGISTRY_TOKEN_CREDENTIALS_ID'), env.IMAGE_REGISTRY_TOKEN_CREDENTIALS_ID)
addStringParam(buildParams, constructKey(paramsPrefix, 'REGISTRY'),
env.IMAGE_REGISTRY)
addStringParam(buildParams, constructKey(paramsPrefix, 'NAMESPACE'),
env.IMAGE_NAMESPACE)
addStringParam(buildParams, constructKey(paramsPrefix, 'TAG'), tag)
diff --git a/.ci/jenkins/config/branch.yaml b/.ci/jenkins/config/branch.yaml
index 145ebe9e..ade29493 100644
--- a/.ci/jenkins/config/branch.yaml
+++ b/.ci/jenkins/config/branch.yaml
@@ -82,9 +82,10 @@ maven:
creds_id: TO_DEFINE
cloud:
image:
- registry_credentials: quay_kiegroup_registry_token
- registry: quay.io
- namespace: kiegroup
+ registry_user_credentials_id: DOCKERHUB_USER
+ registry_token_credentials_id: DOCKERHUB_TOKEN
+ registry: docker.io
+ namespace: apache
latest_git_branch: main
release:
gpg:
@@ -102,7 +103,7 @@ jenkins:
# At some point, this image will need to be changed when a release
branch is created
# but we need to make sure the image exists first ... simple tag
before setting up the branch ?
# See https://github.com/kiegroup/kie-issues/issues/551
- image: quay.io/kiegroup/kogito-ci-build:main-latest
+ image: docker.io/apache/incubator-kie-kogito-ci-build:main-latest
args: --privileged --group-add docker
default_tools:
jdk: jdk_17_latest
diff --git a/.ci/jenkins/config/main.yaml b/.ci/jenkins/config/main.yaml
index 373eea86..221bfbbc 100644
--- a/.ci/jenkins/config/main.yaml
+++ b/.ci/jenkins/config/main.yaml
@@ -37,5 +37,5 @@ jenkins:
# At some point, this image will need to be changed when a release
branch is created
# but we need to make sure the image exists first ... simple tag
before setting up the branch ?
# See https://github.com/kiegroup/kie-issues/issues/551
- image: quay.io/kiegroup/kogito-ci-build:main-latest
+ image: docker.io/apache/incubator-kie-kogito-ci-build:main-latest
args: --privileged --group-add docker
diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy
index 2e001dff..3a850001 100644
--- a/.ci/jenkins/dsl/jobs.groovy
+++ b/.ci/jenkins/dsl/jobs.groovy
@@ -204,7 +204,8 @@ void setupWeeklyCloudJob() {
GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
- IMAGE_REGISTRY_CREDENTIALS: "${CLOUD_IMAGE_REGISTRY_CREDENTIALS}",
+ IMAGE_REGISTRY_USER_CREDENTIALS_ID:
"${CLOUD_IMAGE_REGISTRY_USER_CREDENTIALS_ID}",
+ IMAGE_REGISTRY_TOKEN_CREDENTIALS_ID:
"${CLOUD_IMAGE_REGISTRY_TOKEN_CREDENTIALS_ID}",
IMAGE_REGISTRY: "${CLOUD_IMAGE_REGISTRY}",
IMAGE_NAMESPACE: "${CLOUD_IMAGE_NAMESPACE}",
BRANCH_FOR_LATEST: "${CLOUD_IMAGE_LATEST_GIT_BRANCH}",
@@ -235,7 +236,8 @@ void setupNightlyCloudJob() {
GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
- IMAGE_REGISTRY_CREDENTIALS: "${CLOUD_IMAGE_REGISTRY_CREDENTIALS}",
+ IMAGE_REGISTRY_USER_CREDENTIALS_ID:
"${CLOUD_IMAGE_REGISTRY_USER_CREDENTIALS_ID}",
+ IMAGE_REGISTRY_TOKEN_CREDENTIALS_ID:
"${CLOUD_IMAGE_REGISTRY_TOKEN_CREDENTIALS_ID}",
IMAGE_REGISTRY: "${CLOUD_IMAGE_REGISTRY}",
IMAGE_NAMESPACE: "${CLOUD_IMAGE_NAMESPACE}",
BRANCH_FOR_LATEST: "${CLOUD_IMAGE_LATEST_GIT_BRANCH}",
@@ -304,7 +306,8 @@ void setupReleaseCloudJob() {
GIT_BRANCH_NAME: "${GIT_BRANCH}",
GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
- IMAGE_REGISTRY_CREDENTIALS: "${CLOUD_IMAGE_REGISTRY_CREDENTIALS}",
+ IMAGE_REGISTRY_USER_CREDENTIALS_ID:
"${CLOUD_IMAGE_REGISTRY_USER_CREDENTIALS_ID}",
+ IMAGE_REGISTRY_TOKEN_CREDENTIALS_ID:
"${CLOUD_IMAGE_REGISTRY_TOKEN_CREDENTIALS_ID}",
IMAGE_REGISTRY: "${CLOUD_IMAGE_REGISTRY}",
IMAGE_NAMESPACE: "${CLOUD_IMAGE_NAMESPACE}",
BRANCH_FOR_LATEST: "${CLOUD_IMAGE_LATEST_GIT_BRANCH}",
diff --git a/docs/jenkins.md b/docs/jenkins.md
index b6d1eabc..c61b809f 100644
--- a/docs/jenkins.md
+++ b/docs/jenkins.md
@@ -185,16 +185,16 @@ maven:
#artifacts_repository: ''
cloud:
image:
- registry_credentials_nightly: tradisso_registry_token
- registry_credentials_release: tradisso_registry_token
- registry: quay.io
- namespace: tradisso
+ registry_user_credentials_id: DOCKERHUB_USER
+ registry_user_credentials_id: DOCKERHUB_TOKEN
+ registry: docker.io
+ namespace: apache
latest_git_branch: main
jenkins:
email_creds_id: KOGITO_CI_EMAIL_TO_PERSO
default_tools:
- jdk: jdk_11_latest
- maven: maven_3.8.6
+ jdk: jdk_17_latest
+ maven: maven_3.9.6
```
diff --git a/dsl/scripts/pr_check.groovy b/dsl/scripts/pr_check.groovy
index 49ab0fef..d3eadc07 100644
--- a/dsl/scripts/pr_check.groovy
+++ b/dsl/scripts/pr_check.groovy
@@ -28,7 +28,7 @@ dockerArgs = [
] + dockerGroups.collect { group -> "--group-add ${group}" }
void launch() {
- String builderImage = 'quay.io/kiegroup/kogito-ci-build:main-latest'
+ String builderImage =
'docker.io/apache/incubator-kie-kogito-ci-build:main-latest'
sh "docker rmi -f ${builderImage} || true" // Remove before launching
try {
diff --git a/jenkins-pipeline-shared-libraries/test/vars/MavenSpec.groovy
b/jenkins-pipeline-shared-libraries/test/vars/MavenSpec.groovy
index 8e21c523..97190769 100644
--- a/jenkins-pipeline-shared-libraries/test/vars/MavenSpec.groovy
+++ b/jenkins-pipeline-shared-libraries/test/vars/MavenSpec.groovy
@@ -148,7 +148,7 @@ class MavenSpec extends JenkinsPipelineSpecification {
when:
mavenGroovy.mvnVersionsSet(newVersion)
then:
- 1 * getPipelineMock("sh")([script: "mvn -B -N -e versions:set -Dfull
-DnewVersion=${newVersion} -DallowSnapshots=false -DgenerateBackupPoms=false",
returnStdout: false])
+ 1 * getPipelineMock("sh")([script: "mvn -B -N -e versions:set -Dfull
-DnewVersion=${newVersion} -DallowSnapshots=false -DprocessAllModules=true
-DgenerateBackupPoms=false", returnStdout: false])
}
def "[maven.groovy] run mvn versions set with allow snapshots"() {
@@ -157,7 +157,7 @@ class MavenSpec extends JenkinsPipelineSpecification {
when:
mavenGroovy.mvnVersionsSet(newVersion, true)
then:
- 1 * getPipelineMock("sh")([script: "mvn -B -N -e versions:set -Dfull
-DnewVersion=${newVersion} -DallowSnapshots=true -DgenerateBackupPoms=false",
returnStdout: false])
+ 1 * getPipelineMock("sh")([script: "mvn -B -N -e versions:set -Dfull
-DnewVersion=${newVersion} -DallowSnapshots=true -DprocessAllModules=true
-DgenerateBackupPoms=false", returnStdout: false])
}
def "[maven.groovy] run mvn versions update parent"() {
diff --git a/jenkins-pipeline-shared-libraries/vars/maven.groovy
b/jenkins-pipeline-shared-libraries/vars/maven.groovy
index 1ac1f77d..b8382fb5 100644
--- a/jenkins-pipeline-shared-libraries/vars/maven.groovy
+++ b/jenkins-pipeline-shared-libraries/vars/maven.groovy
@@ -59,12 +59,13 @@ def mvnVersionsSet(String newVersion, boolean
allowSnapshots = false) {
mvnVersionsSet(new MavenCommand(this), newVersion, allowSnapshots)
}
-def mvnVersionsSet(MavenCommand mvnCmd, String newVersion, boolean
allowSnapshots = false) {
+def mvnVersionsSet(MavenCommand mvnCmd, String newVersion, boolean
allowSnapshots = false, boolean processAllModules = true) {
mvnCmd.clone()
.withOptions(['-N', '-e'])
.withProperty('full')
.withProperty('newVersion', newVersion)
.withProperty('allowSnapshots', allowSnapshots)
+ .withProperty('processAllModules', processAllModules)
.withProperty('generateBackupPoms', false)
.run('versions:set')
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]