Kusuma04-dev commented on code in PR #7123: URL: https://github.com/apache/incubator-kie/pull/7123#discussion_r4493612517
########## .ci/jenkins/Jenkinsfile.103xplus.release-candidate: ########## @@ -0,0 +1,211 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, 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. + */ + +// 10.3.x+ release pipeline — fully independent, no kogito-pipelines / jobs.groovy dependency. +// - No @Library, no DSL-injected env vars, no drools-deploy / drools-promote downstream jobs +// - Create a plain "Pipeline script from SCM" job pointing at this file and run it +// with a few parameters. Everything it needs is a parameter (with a default). +// - Runs script/release/release-all.sh (R commit + RC tag -> build -> Nexus staging) +// +// MANDATORY parameters : RELEASE_VERSION, TAG_NAME +// Real RC run : DEPLOY=true, PUSH_TAG=true, DRY_RUN=false (the defaults) +// Branch cut (once per minor, before rc1 only): +// CREATE_STREAM_BRANCH=true -> creates X.Y.x from main, +// sets X.Y.999-SNAPSHOT, pushes it, then continues the RC on X.Y.x. +// Leave it false for rc2, final and patch releases (branch already exists). + +pipeline { + agent { + label 'ubuntu' + } + + tools { + maven 'maven_3.9.16' + jdk 'jdk_17_latest' + } + + options { + timestamps() + timeout(time: 360, unit: 'MINUTES') + } + + parameters { + string(name: 'RELEASE_VERSION', defaultValue: '', description: 'MANDATORY. Exact release version, e.g. 10.3.0', trim: true) + string(name: 'TAG_NAME', defaultValue: '', description: 'MANDATORY. RC tag name, e.g. 10.3.0-rc1 (must start with RELEASE_VERSION and be a new tag)', trim: true) + booleanParam(name: 'CREATE_STREAM_BRANCH', defaultValue: false, description: 'Branch cut: create X.Y.x (derived from RELEASE_VERSION) from main, set X.Y.999-SNAPSHOT and push it BEFORE building the RC. Only for the first RC of a new minor (e.g. 10.3.0-rc1). Fails if X.Y.x already exists') + booleanParam(name: 'SKIP_TESTS', defaultValue: true, description: 'Skip running tests during reactor build') + booleanParam(name: 'DEPLOY', defaultValue: true, description: 'Deploy artifacts to Apache Nexus staging') + string(name: 'STAGING_URL', defaultValue: '', description: 'Custom Nexus staging URL (optional)') + booleanParam(name: 'PUSH_TAG', defaultValue: true, description: 'Push the git tag to origin') + string(name: 'EXTRA_MAVEN_OPTS', defaultValue: '', description: 'Extra Maven CLI options to pass to build.sh') + booleanParam(name: 'DRY_RUN', defaultValue: false, description: 'Dry run without making remote git or staging changes') + + // Jenkins IDs — defaults match the existing KIE Jenkins; override only if they differ. + string(name: 'MAVEN_SETTINGS_CONFIG_FILE_ID', defaultValue: 'kie-release-authn-settings', description: 'Config File Provider ID of the Maven settings.xml (must define server "apache.releases.https")', trim: true) + string(name: 'GPG_KEY_CREDS_ID', defaultValue: 'GPG_KEY_FILE', description: 'Secret FILE credential ID holding the armored GPG private key', trim: true) + string(name: 'GPG_PASSPHRASE_CREDS_ID', defaultValue: '', description: 'Optional. Secret TEXT credential ID holding the GPG key passphrase. Leave empty if the key has no passphrase (KIE release key has none)', trim: true) + string(name: 'GIT_PUSH_CREDS_ID', defaultValue: '84811880-2025-45b6-a44c-2f33bef30ad2', description: 'Username/password credential ID used to push the RC tag to GitHub', trim: true) + } + + stages { + stage('Initialize & Validate') { + steps { + script { + if (!params.RELEASE_VERSION?.trim()) { + error 'RELEASE_VERSION parameter is mandatory (e.g. 10.3.0)' + } + if (!params.TAG_NAME?.trim()) { + error 'TAG_NAME parameter is mandatory (e.g. 10.3.0-rc1)' + } + if (!params.TAG_NAME.startsWith(params.RELEASE_VERSION)) { + error "TAG_NAME '${params.TAG_NAME}' must start with RELEASE_VERSION '${params.RELEASE_VERSION}'" + } Review Comment: These strict regex validations are not needed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
