diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 7a3a6be7c7e..71a56a24b4b 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -90,7 +90,7 @@ pipeline { } stage('Prepare for PR') { when { - expression { return isRelease() || isCreatePr() } + expression { return isCreatePr() } } steps { script { @@ -120,7 +120,7 @@ pipeline { 'version.org.kie', getDroolsVersion() ) - // Need artifacts available locally + // Need artifacts available locally getMavenCommand() .withProperty('quickly') .withSettingsXmlFile(MAVEN_SETTINGS_FILE) @@ -152,22 +152,16 @@ pipeline { if (params.SKIP_TESTS) { mvnCmd.skipTests() // Conflict somehow with Python testing. If `skipTests={anyvalue}` is set, then exec plugin is not executed ... } - def Closure mavenRunClosure = { - configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) { - mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE) - .run("clean $installOrDeploy") - } - } if (isRelease()) { - release.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId()) - mavenCommand + releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId()) + mvnCmd .withProfiles(['apache-release']) .withProperty('only.reproducible') - mavenRunClosure() - } else { - mavenRunClosure() } - + configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) { + mvnCmd.withSettingsXmlFile(MAVEN_SETTINGS_FILE) + .run("clean $installOrDeploy") + } } } } @@ -182,7 +176,7 @@ pipeline { } stage('Create PR') { when { - expression { return isRelease() || isCreatePr() } + expression { return isCreatePr() } } steps { script { @@ -206,6 +200,26 @@ pipeline { } } } + stage('Commit and Create Tag') { + when { + expression { return isRelease() } + } + steps { + script { + dir(getRepoName()) { + if (githubscm.isThereAnyChanges()) { + def commitMsg = "[${getBuildBranch()}] Update version to ${getProjectVersion()}" + githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) + githubscm.commitChanges(commitMsg, { githubscm.findAndStageNotIgnoredFiles('pom.xml') }) + } else { + println '[WARN] no changes to commit' + } + githubscm.tagRepository(getGitTagName()) + githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId()) + } + } + } + } } post { always { @@ -326,3 +340,7 @@ String getReleaseGpgSignKeyCredsId() { String getReleaseGpgSignPassphraseCredsId() { return env.RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID } + +String getGitTagName() { + return params.GIT_TAG_NAME +} diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index d0ac6d88049..6c31c8377b8 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -214,6 +214,7 @@ void setupReleaseDeployJob() { stringParam('PROJECT_VERSION', '', 'Set the project version') stringParam('DROOLS_VERSION', '', 'Drools version to set') stringParam('KOGITO_PR_BRANCH', '', 'PR branch name') + stringParam('GIT_TAG_NAME', '', 'Git tag to create. i.e.: 10.0.0-rc1') booleanParam('SEND_NOTIFICATION', false, 'In case you want the pipeline to send a notification on CI channel for this run.') } diff --git a/addons/common/persistence/postgresql/src/main/resources/db/migration/V1.35.0__create_runtime_PostgreSQL.sql b/addons/common/persistence/postgresql/src/main/resources/db/migration/V1.35.0__create_runtime_PostgreSQL.sql new file mode 100644 index 00000000000..741764283e1 --- /dev/null +++ b/addons/common/persistence/postgresql/src/main/resources/db/migration/V1.35.0__create_runtime_PostgreSQL.sql @@ -0,0 +1,42 @@ +-- +-- 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. +-- + +-- To be used with kie-addons-quarkus-persistence-jdbc for Quarkus or kie-addons-springboot-persistence-jdbc for SpringBoot +CREATE TABLE process_instances +( + id character(36) NOT NULL, + payload bytea NOT NULL, + process_id character varying NOT NULL, + version bigint, + process_version character varying, + CONSTRAINT process_instances_pkey PRIMARY KEY (id) +); +CREATE INDEX idx_process_instances_process_id ON process_instances (process_id, id, process_version); + +CREATE TABLE correlation_instances +( + id character(36) NOT NULL, + encoded_correlation_id character varying(36) NOT NULL UNIQUE, + correlated_id character varying(36) NOT NULL, + correlation json NOT NULL, + version bigint, + CONSTRAINT correlation_instances_pkey PRIMARY KEY (id) +); +CREATE INDEX idx_correlation_instances_encoded_id ON correlation_instances (encoded_correlation_id); +CREATE INDEX idx_correlation_instances_correlated_id ON correlation_instances (correlated_id); diff --git a/addons/common/persistence/postgresql/src/main/resources/db/migration/V10.0.0__add_business_key_PostgreSQL.sql b/addons/common/persistence/postgresql/src/main/resources/db/migration/V10.0.0__add_business_key_PostgreSQL.sql new file mode 100644 index 00000000000..22ef0f40844 --- /dev/null +++ b/addons/common/persistence/postgresql/src/main/resources/db/migration/V10.0.0__add_business_key_PostgreSQL.sql @@ -0,0 +1,31 @@ +-- +-- 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. +-- + +CREATE TABLE business_key_mapping ( + business_key character (255) NOT NULL, + process_instance_id character (36) NOT NULL, + PRIMARY KEY (business_key), + CONSTRAINT fk_process_instances + FOREIGN KEY (process_instance_id) + REFERENCES process_instances(id) + ON DELETE CASCADE +); + + +CREATE INDEX idx_business_key_process_instance_id ON business_key_mapping (process_instance_id); diff --git a/addons/common/persistence/postgresql/src/main/resources/db/migration/V10.0.1__alter_correlation_PostgreSQL.sql b/addons/common/persistence/postgresql/src/main/resources/db/migration/V10.0.1__alter_correlation_PostgreSQL.sql new file mode 100644 index 00000000000..42a9340b4ea --- /dev/null +++ b/addons/common/persistence/postgresql/src/main/resources/db/migration/V10.0.1__alter_correlation_PostgreSQL.sql @@ -0,0 +1,21 @@ +-- +-- 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. +-- + +ALTER TABLE correlation_instances +ALTER COLUMN correlation TYPE character varying;