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

kie-issues#1214: Replace explicit references to quay.io images across CI pipelines #1207

Merged
merged 4 commits into from
Jun 20, 2024
Merged
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
3 changes: 2 additions & 1 deletion .ci/jenkins/Jenkinsfile.nightly.cloud
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion .ci/jenkins/Jenkinsfile.release.cloud
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion .ci/jenkins/Jenkinsfile.weekly.cloud
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions .ci/jenkins/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .ci/jenkins/config/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 6 additions & 3 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down
12 changes: 6 additions & 6 deletions docs/jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```

Expand Down
2 changes: 1 addition & 1 deletion dsl/scripts/pr_check.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions jenkins-pipeline-shared-libraries/test/vars/MavenSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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"() {
Expand All @@ -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"() {
Expand Down
3 changes: 2 additions & 1 deletion jenkins-pipeline-shared-libraries/vars/maven.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
Loading