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-tools-temporary-rnd-do-not-use.git
commit 137355d96db94167e4729e6a00659f2e5218214c Author: Rodrigo Antunes <[email protected]> AuthorDate: Thu Nov 30 09:12:11 2023 -0300 CI - Release Jenkins jobs (#15) * CI - Release Jenkins jobs * Add Release publish and Release dry run jobs * Fix base ref for dry run job * CI - Release Jenkins jobs * Fix conditional * Use shared scripts * Rename jobs * Fix jobs names --- .ci/jenkins/.groovylintrc.json | 16 + .ci/jenkins/Jenkinsfile.release-build | 454 +++++++++++++++++++++ .ci/jenkins/Jenkinsfile.release-dry-run | 45 ++ .ci/jenkins/Jenkinsfile.release-publish | 105 +++++ .../release-jobs/Jenkinsfile.chrome-extensions | 351 ++++++++++++++++ .ci/jenkins/release-jobs/Jenkinsfile.cors-proxy | 167 ++++++++ .../Jenkinsfile.dashbuilder-viewer-image | 143 +++++++ .../release-jobs/Jenkinsfile.dmn-dev-deployment | 147 +++++++ .../release-jobs/Jenkinsfile.extended-services | 133 ++++++ .ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox | 192 +++++++++ .../Jenkinsfile.kie-sandbox-extended-services | 167 ++++++++ .../release-jobs/Jenkinsfile.kn-plugin-workflow | 180 ++++++++ .ci/jenkins/release-jobs/Jenkinsfile.npm-packages | 137 +++++++ .ci/jenkins/release-jobs/Jenkinsfile.online-editor | 195 +++++++++ .../Jenkinsfile.serverless-logic-web-tools | 184 +++++++++ ...e.serverless-logic-web-tools-base-builder-image | 143 +++++++ ...le.serverless-logic-web-tools-swf-builder-image | 143 +++++++ ...e.serverless-logic-web-tools-swf-dev-mode-image | 143 +++++++ .../Jenkinsfile.standalone-editors-cdn | 173 ++++++++ .../release-jobs/Jenkinsfile.vscode-extensions-dev | 129 ++++++ .../Jenkinsfile.vscode-extensions-prod | 242 +++++++++++ 21 files changed, 3589 insertions(+) diff --git a/.ci/jenkins/.groovylintrc.json b/.ci/jenkins/.groovylintrc.json new file mode 100644 index 0000000000..e1c2cd46c7 --- /dev/null +++ b/.ci/jenkins/.groovylintrc.json @@ -0,0 +1,16 @@ +{ + "extends": "recommended-jenkinsfile", + "rules": { + "CouldBeElvis": "off", + "CouldBeSwitchStatement": "off", + "DuplicateStringLiteral": { + "enabled": false + }, + "LineLength": { + "enabled": false + }, + "VariableName": { + "severity": "info" + } + } +} diff --git a/.ci/jenkins/Jenkinsfile.release-build b/.ci/jenkins/Jenkinsfile.release-build new file mode 100644 index 0000000000..0e0b80384a --- /dev/null +++ b/.ci/jenkins/Jenkinsfile.release-build @@ -0,0 +1,454 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 500, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Base Ref', name: 'BASE_REF') + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Upload asset url', name: 'UPLOAD_ASSET_URL', defaultValue: '') + string(description: 'Runners', name: 'RUNNERS', defaultValue: '{"dmn_dev_deployment_base_image":"false","kie_sandbox_image":"false","kie_sandbox_extended_services_image":"false","cors_proxy_image":"false","online_editor":"false","chrome_extensions":"false","vscode_extensions_dev":"false","vscode_extensions_prod":"false","npm_packages":"false","standalone_editors_cdn":"false","extended_services":"false","serverless_logic_web_tools":"false","serverless_logic_web_tools_swf_builder_i [...] + } + + environment { + OPENSHIFT_NAMESPACE = 'kie-sandbox' + DMN_DEV_DEPLOYMENT_BASE_IMAGE_JOB_RESULT = 'SKIPPED' + KIE_SANDBOX_EXTENDED_SERVICES_IMAGE_JOB_RESULT = 'SKIPPED' + CORS_PROXY_IMAGE_JOB_RESULT = 'SKIPPED' + KIE_SANDBOX_IMAGE_JOB_RESULT = 'SKIPPED' + ONLINE_EDITOR_JOB_RESULT = 'SKIPPED' + CHROME_EXTENSIONS_JOB_RESULT = 'SKIPPED' + EXTENDED_SERVICES_JOB_RESULT = 'SKIPPED' + SERVERLESS_LOGIC_WEB_TOOLS_SWF_BUILDER_IMAGE_JOB_RESULT = 'SKIPPED' + SERVERLESS_LOGIC_WEB_TOOLS_BASE_BUILDER_IMAGE_JOB_RESULT = 'SKIPPED' + SERVERLESS_LOGIC_WEB_TOOLS_SWF_DEV_MODE_IMAGE_JOB_RESULT = 'SKIPPED' + DASHBUILDER_VIEWER_IMAGE_JOB_RESULT = 'SKIPPED' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + openShiftUtils = load '.ci/jenkins/shared-scripts/openShiftUtils.groovy' + } + } + } + + stage('Set Runners') { + steps { + script { + runners = readJSON text: "${env.RUNNERS}" + env.DMN_DEV_DEPLOYMENT_BASE_IMAGE = runners.dmn_dev_deployment_base_image + env.KIE_SANDBOX_IMAGE = runners.kie_sandbox_image + env.KIE_SANDBOX_EXTENDED_SERVICES_IMAGE = runners.kie_sandbox_extended_services_image + env.CORS_PROXY_IMAGE = runners.cors_proxy_image + env.ONLINE_EDITOR = runners.online_editor + env.CHROME_EXTENSIONS = runners.chrome_extensions + env.VSCODE_EXTENSIONS_DEV = runners.vscode_extensions_dev + env.VSCODE_EXTENSIONS_PROD = runners.vscode_extensions_prod + env.NPM_PACKAGES = runners.npm_packages + env.STANDALONE_EDITORS_CDN = runners.standalone_editors_cdn + env.EXTENDED_SERVICES = runners.extended_services + env.SERVERLESS_LOGIC_WEB_TOOLS = runners.serverless_logic_web_tools + env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_BUILDER_IMAGE = runners.serverless_logic_web_tools_swf_builder_image + env.SERVERLESS_LOGIC_WEB_TOOLS_BASE_BUILDER_IMAGE = runners.serverless_logic_web_tools_base_builder_image + env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_DEV_MODE_IMAGE = runners.serverless_logic_web_tools_swf_dev_mode_image + env.DASHBUILDER_VIEWER_IMAGE = runners.dashbuilder_viewer_image + env.KN_PLUGIN_WORKFLOW = runners.kn_plugin_workflow + } + } + } + + stage('Print Runners') { + steps { + sh """ + echo "dmn_dev_deployment_base_image: ${env.DMN_DEV_DEPLOYMENT_BASE_IMAGE}" + echo "kie_sandbox_image: ${env.KIE_SANDBOX_IMAGE}" + echo "kie_sandbox_extended_services_image: ${env.KIE_SANDBOX_EXTENDED_SERVICES_IMAGE}" + echo "cors_proxy_image: ${env.CORS_PROXY_IMAGE}" + echo "online_editor: ${env.ONLINE_EDITOR}" + echo "chrome_extensions: ${env.CHROME_EXTENSIONS}" + echo "vscode_extensions_dev: ${env.VSCODE_EXTENSIONS_DEV}" + echo "vscode_extensions_prod: ${env.VSCODE_EXTENSIONS_PROD}" + echo "npm_packages: ${env.NPM_PACKAGES}" + echo "standalone_editors_cdn: ${env.STANDALONE_EDITORS_CDN}" + echo "extended_services: ${env.EXTENDED_SERVICES}" + echo "serverless_logic_web_tools: ${env.SERVERLESS_LOGIC_WEB_TOOLS}" + echo "serverless_logic_web_tools_swf_builder_image: ${env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_BUILDER_IMAGE}" + echo "serverless_logic_web_tools_base_builder_image: ${env.SERVERLESS_LOGIC_WEB_TOOLS_BASE_BUILDER_IMAGE}" + echo "serverless_logic_web_tools_swf_dev_mode_image: ${env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_DEV_MODE_IMAGE}" + echo "dashbuilder_viewer_image: ${env.DASHBUILDER_VIEWER_IMAGE}" + echo "kn_plugin_workflow: ${env.KN_PLUGIN_WORKFLOW}" + """.trim() + } + } + + stage('DMN Dev Deployment Base Image') { + when { + expression { env.DMN_DEV_DEPLOYMENT_BASE_IMAGE == 'true' } + } + steps { + script { + env.DMN_DEV_DEPLOYMENT_BASE_IMAGE_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/dmn-dev-deployment', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + } + } + } + + stage('KIE Sandbox Extended Services Image') { + when { + expression { env.KIE_SANDBOX_EXTENDED_SERVICES_IMAGE == 'true' } + } + steps { + script { + env.KIE_SANDBOX_EXTENDED_SERVICES_IMAGE_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/kie-sandbox-extended-services', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + + env.KIE_SANDBOX_EXTENDED_SERVICES_URL = openShiftUtils.getAppRoute("${env.OPENSHIFT_NAMESPACE}", 'kie-sandbox-extended-services', "${pipelineVars.openshiftCredentialsId}") + } + } + } + + stage('CORS Proxy Image') { + when { + expression { env.CORS_PROXY_IMAGE == 'true' } + } + steps { + script { + env.CORS_PROXY_IMAGE_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/cors-proxy', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + + env.KIE_SANDBOX_CORS_PROXY_URL = openShiftUtils.getAppRoute("${env.OPENSHIFT_NAMESPACE}", 'cors-proxy', "${pipelineVars.openshiftCredentialsId}") + } + } + } + + stage('KIE Sandbox Image') { + when { + expression { env.KIE_SANDBOX_IMAGE == 'true' } + } + steps { + script { + env.KIE_SANDBOX_IMAGE_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/kie-sandbox', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}"), + string(name: 'KIE_SANDBOX_EXTENDED_SERVICES_URL', value: "${env.KIE_SANDBOX_EXTENDED_SERVICES_URL}"), + string(name: 'KIE_SANDBOX_CORS_PROXY_URL', value: "${env.KIE_SANDBOX_CORS_PROXY_URL}") + ] + ).result + + env.KIE_SANDBOX_URL = openShiftUtils.getAppRoute("${env.OPENSHIFT_NAMESPACE}", 'kie-sandbox', "${pipelineVars.openshiftCredentialsId}") + } + } + } + + // TODO: Verify Windows + MacOS builds + stage('Extendend Services') { + when { + expression { env.EXTENDED_SERVICES == 'true' } + } + steps { + script { + env.EXTENDED_SERVICES_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/extended-services', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}"), + string(name: 'UPLOAD_ASSET_URL', value: "${params.UPLOAD_ASSET_URL}") + ] + ).result + } + } + } + + stage('Online Editor') { + when { + expression { env.ONLINE_EDITOR == 'true' && (env.EXTENDED_SERVICES_JOB_RESULT == 'SUCCESS' || env.EXTENDED_SERVICES_JOB_RESULT == 'SKIPPED') && (env.DMN_DEV_DEPLOYMENT_BASE_IMAGE_JOB_RESULT == 'SUCCESS' || env.DMN_DEV_DEPLOYMENT_BASE_IMAGE_JOB_RESULT == 'SKIPPED') } + } + steps { + script { + env.ONLINE_EDITOR_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/online-editor', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + } + } + } + + stage('Chrome Extensions') { + when { + expression { env.CHROME_EXTENSIONS == 'true' && (env.EXTENDED_SERVICES_JOB_RESULT == 'SUCCESS' || env.EXTENDED_SERVICES_JOB_RESULT == 'SKIPPED') && (env.DMN_DEV_DEPLOYMENT_BASE_IMAGE_JOB_RESULT == 'SUCCESS' || env.DMN_DEV_DEPLOYMENT_BASE_IMAGE_JOB_RESULT == 'SKIPPED') && (env.ONLINE_EDITOR_JOB_RESULT == 'SUCCESS' || env.ONLINE_EDITOR_JOB_RESULT == 'SKIPPED') } + } + steps { + script { + env.CHROME_EXTENSIONS_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/chrome-extensions', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}"), + string(name: 'UPLOAD_ASSET_URL', value: "${params.UPLOAD_ASSET_URL}") + ] + ).result + } + } + } + + stage('VSCode Extensions Dev') { + when { + expression { env.VSCODE_EXTENSIONS_DEV == 'true' } + } + steps { + script { + env.VSCODE_EXTENSIONS_DEV_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/vscode-extensions-dev', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}"), + string(name: 'UPLOAD_ASSET_URL', value: "${params.UPLOAD_ASSET_URL}") + ] + ).result + } + } + } + + stage('VSCode Extensions Prod') { + when { + expression { env.VSCODE_EXTENSIONS_PROD == 'true' } + } + steps { + script { + env.CHROME_EXTENSIONS_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/vscode-extensions-prod', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}"), + string(name: 'UPLOAD_ASSET_URL', value: "${params.UPLOAD_ASSET_URL}") + ] + ).result + } + } + } + + stage('NPM Packages') { + when { + expression { env.NPM_PACKAGES == 'true' } + } + steps { + script { + env.NPM_PACKAGES_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/npm-packages', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + } + } + } + + stage('Standalone Editors CDN') { + when { + expression { env.STANDALONE_EDITORS_CDN == 'true' && (env.EXTENDED_SERVICES_JOB_RESULT == 'SUCCESS' || env.EXTENDED_SERVICES_JOB_RESULT == 'SKIPPED') && (env.DMN_DEV_DEPLOYMENT_BASE_IMAGE_JOB_RESULT == 'SUCCESS' || env.DMN_DEV_DEPLOYMENT_BASE_IMAGE_JOB_RESULT == 'SKIPPED') && (env.ONLINE_EDITOR_JOB_RESULT == 'SUCCESS' || env.ONLINE_EDITOR_JOB_RESULT == 'SKIPPED') && (env.CHROME_EXTENSIONS_JOB_RESULT == 'SUCCESS' || env.CHROME_EXTENSIONS_JOB_RESULT == 'SKIPPED') } + } + steps { + script { + env.STANDALONE_EDITORS_CDN_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/standalone-editors-cdn', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + } + } + } + + stage('Kn Plugin Workflow') { + when { + expression { env.KN_PLUGIN_WORKFLOW == 'true' } + } + steps { + script { + env.KN_PLUGIN_WORKFLOW_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/kn-plugin-workflow', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}"), + string(name: 'UPLOAD_ASSET_URL', value: "${params.UPLOAD_ASSET_URL}") + ] + ).result + } + } + } + + stage('Serverless Logic Web Tools Swf Builder Image') { + when { + expression { env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_BUILDER_IMAGE == 'true' } + } + steps { + script { + env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_BUILDER_IMAGE_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/serverless-logic-web-tools-swf-builder-image', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + } + } + } + + stage('Serverless Logic Web Tools Swf Dev Mode Image') { + when { + expression { env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_DEV_MODE_IMAGE == 'true' } + } + steps { + script { + env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_DEV_MODE_IMAGE_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/serverless-logic-web-tools-swf-dev-mode-image', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + } + } + } + + stage('Serverless Logic Web Tools Base Builder Image') { + when { + expression { env.SERVERLESS_LOGIC_WEB_TOOLS_BASE_BUILDER_IMAGE == 'true' } + } + steps { + script { + env.SERVERLESS_LOGIC_WEB_TOOLS_BASE_BUILDER_IMAGE_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/serverless-logic-web-tools-base-builder-image', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + } + } + } + + stage('Dashbuilder Viewer Image') { + when { + expression { env.DASHBUILDER_VIEWER_IMAGE == 'true' } + } + steps { + script { + env.DASHBUILDER_VIEWER_IMAGE_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/dashbuilder-viewer-image', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + } + } + } + + stage('Serverless Logic Web Tools') { + when { + expression { env.SERVERLESS_LOGIC_WEB_TOOLS == 'true' && (env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_BUILDER_IMAGE_JOB_RESULT == 'SUCCESS' || env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_BUILDER_IMAGE_JOB_RESULT == 'SKIPPED') && (env.SERVERLESS_LOGIC_WEB_TOOLS_BASE_BUILDER_IMAGE_JOB_RESULT == 'SUCCESS' || env.SERVERLESS_LOGIC_WEB_TOOLS_BASE_BUILDER_IMAGE_JOB_RESULT == 'SKIPPED') && (env.SERVERLESS_LOGIC_WEB_TOOLS_SWF_DEV_MODE_IMAGE_JOB_RESULT == 'SUCCESS' || env.SERVERLESS_LOGIC_WEB_TOOLS_ [...] + } + steps { + script { + env.DASHBUILDER_VIEWER_IMAGE_JOB_RESULT = build( + wait: true, + job: 'KIE/kie-tools/kie-tools-release-jobs/serverless-logic-web-tools', + parameters: [ + booleanParam(name: 'DRY_RUN', value: "${params.DRY_RUN}"), + string(name: 'BASE_REF', value: "${params.BASE_REF}"), + string(name: 'TAG', value: "${params.TAG}") + ] + ).result + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/Jenkinsfile.release-dry-run b/.ci/jenkins/Jenkinsfile.release-dry-run new file mode 100644 index 0000000000..a37a21a0e0 --- /dev/null +++ b/.ci/jenkins/Jenkinsfile.release-dry-run @@ -0,0 +1,45 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + } + } + + options { + timeout(time: 240, unit: 'MINUTES') + } + + stages { + stage('Release (dry run)') { + steps { + build job: 'KIE/kie-tools/kie-tools-release-build', parameters: [ + booleanParam(name: 'DRY_RUN', value: true), + string(name: 'BASE_REF', value: 'main'), + string(name: 'RUNNERS', value: '{"dmn_dev_deployment_base_image":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","serverless_logic_web_tools":"true","serverless_logic_web_tools_swf_builder_image":"true","serverless_logic_ [...] + ] + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/Jenkinsfile.release-publish b/.ci/jenkins/Jenkinsfile.release-publish new file mode 100644 index 0000000000..687254f0cc --- /dev/null +++ b/.ci/jenkins/Jenkinsfile.release-publish @@ -0,0 +1,105 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + } + } + + options { + timeout(time: 240, unit: 'MINUTES') + } + + parameters { + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Runners', name: 'RUNNERS', defaultValue: '{"dmn_dev_deployment_base_image":"true","kie_sandbox_image":"true","kie_sandbox_extended_services_image":"true","cors_proxy_image":"true","online_editor":"true","chrome_extensions":"true","vscode_extensions_dev":"true","vscode_extensions_prod":"true","npm_packages":"true","standalone_editors_cdn":"true","extended_services":"true","serverless_logic_web_tools":"true","serverless_logic_web_tools_swf_builder_image":"true" [...] + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage("Fetch release for ${params.TAG}") { + steps { + script { + response = githubUtils.fetchRelease("${pipelineVars.githubRepositorySlug}", "${params.TAG}", "${pipelineVars.kieToolsBotGithubTokenCredentialsId}") + respJSON = readJSON text: response + env.RELEASE_TAG_REF = respJSON.target_commitish + env.RELEASE_UPLOAD_ASSET_URL = githubUtils.parseReleaseAssetUploadUrl(respJSON.upload_url) + } + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${env.RELEASE_TAG_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Check `tag` against `package.json.version`') { + steps { + dir('kie-tools') { + script { + packageVersion = sh(returnStdout: true, script: "#!/bin/bash -el \n node -p \"require('./package.json').version\"").trim() + sh """#!/bin/bash -el + [[ "${params.TAG}" == "${packageVersion}" ]] + """.trim() + } + } + } + } + + stage('Release Build and Publish') { + steps { + build job: 'KIE/kie-tools/kie-tools-release-build', parameters: [ + booleanParam(name: 'DRY_RUN', value: false), + string(name: 'BASE_REF', value: "${env.RELEASE_TAG_REF}"), + string(name: 'TAG', value: "${params.TAG}"), + string(name: 'UPLOAD_ASSET_URL', value: "${env.RELEASE_UPLOAD_ASSET_URL}"), + string(name: 'RUNNERS', value: "${params.RUNNERS}") + ] + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.chrome-extensions b/.ci/jenkins/release-jobs/Jenkinsfile.chrome-extensions new file mode 100644 index 0000000000..772cac8e46 --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.chrome-extensions @@ -0,0 +1,351 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + string(description: 'Upload Asset Url', name: 'UPLOAD_ASSET_URL') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + CHROME_EXTENSION__routerTargetOrigin = 'https://kiegroup.github.io' + CHROME_EXTENSION__routerRelativePath = "kogito-online/chrome-extension/${params.TAG}" + CHROME_EXTENSION__manifestFile = 'manifest.prod.json' + CHROME_EXTENSION__onlineEditorUrl = 'https://kiegroup.github.io/kogito-online' + SWF_CHROME_EXTENSION__routerTargetOrigin = 'https://kiegroup.github.io' + SWF_CHROME_EXTENSION__routerRelativePath = "kogito-online/swf-chrome-extension/${params.TAG}" + SWF_CHROME_EXTENSION__manifestFile = 'manifest.prod.json' + + PNPM_FILTER_STRING = '-F chrome-extension-pack-kogito-kie-editors... -F chrome-extension-serverless-workflow-editor...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + chromeStoreUtils = load '.ci/jenkins/shared-scripts/chromeStoreUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Checkout kogito-online') { + steps { + dir('kogito-online') { + script { + githubUtils.checkoutRepo( + 'http://github.com/kiegroup/kogito-online.git', + 'gh-pages', + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Upload Chrome Extension for Kogito KIE Editors') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "kie-tools/packages/chrome-extension-pack-kogito-kie-editors/dist/chrome_extension_kogito_kie_editors_${params.TAG}.zip", + "chrome_extension_kogito_kie_editors_${params.TAG}.zip", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Deploy Chrome Extension for KIE Editors to GitHub Pages (kogito-online)') { + when { + expression { !params.DRY_RUN } + } + steps { + dir('kogito-online') { + script { + EDITORS_DIR = "editors/${params.TAG}" + CHROME_EXTENSION_DIR = "chrome-extension/${params.TAG}" + + sh """#!/bin/bash -el + git config --global user.email '[email protected]' + git config --global user.name 'KIE Tools Bot (kiegroup)' + git checkout gh-pages + + echo "Copy Chrome Extension resources" + rm -rf ${CHROME_EXTENSION_DIR} + mkdir -p ${CHROME_EXTENSION_DIR} + cp -r ${WORKSPACE}/kie-tools/packages/chrome-extension-pack-kogito-kie-editors/dist/{fonts,*-envelope.*} ${CHROME_EXTENSION_DIR} + ln -s ../../${EDITORS_DIR}/bpmn ${CHROME_EXTENSION_DIR}/bpmn + ln -s ../../${EDITORS_DIR}/dmn ${CHROME_EXTENSION_DIR}/dmn + ln -s ../../${EDITORS_DIR}/scesim ${CHROME_EXTENSION_DIR}/scesim + + echo "Commit changes and push" + git add . + git commit -m "Deploy ${params.TAG} (Chrome Extension for Kogito KIE Editors)" + """.trim() + + withCredentials([usernamePassword(credentialsId: "${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', passwordVariable: 'GH_PASSWORD')]) { + sh('set +x && git push https://$GH_USER:[email protected]/kiegroup/kogito-online.git gh-pages') + } + } + } + } + } + + stage('Upload Chrome Extension for KIE Editors to the Chrome Store') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + env.CHROME_EXTESION_KIE_EDITORS_UPLOAD_STATUS = chromeStoreUtils.uploadExtension( + "${pipelineVars.chromeStoreCredentialsId}", + "${pipelineVars.chromeStoreRefreshTokenCredentialsId}", + "kie-tools/packages/chrome-extension-pack-kogito-kie-editors/dist/chrome_extension_kogito_kie_editors_${params.TAG}.zip", + 'EXTENSION_ID' + ) + } + } + } + + stage('Check Upload - Chrome Extension for KIE Editors') { + when { + expression { !params.DRY_RUN } + } + steps { + sh """#!/bin/bash -el + [[ "${env.CHROME_EXTESION_KIE_EDITORS_UPLOAD_STATUS}" == "SUCCESS" ]]" + """.trim() + } + } + + stage('Publish Chrome Extension for KIE Editors for users') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + env.CHROME_EXTESION_KIE_EDITORS_PUBLISH_STATUS = chromeStoreUtils.publishExtension( + "${pipelineVars.chromeStoreCredentialsId}", + "${pipelineVars.chromeStoreRefreshTokenCredentialsId}", + 'EXTENSION_ID' + ) + } + } + } + + stage('Check Publish - Chrome Extension for KIE Editors') { + when { + expression { !params.DRY_RUN } + } + steps { + sh """#!/bin/bash -el + [[ "${env.CHROME_EXTESION_KIE_EDITORS_PUBLISH_STATUS}" == "OK" ]] || [[ "${env.CHROME_EXTESION_KIE_EDITORS_PUBLISH_STATUS}" == "PUBLISHED_WITH_FRICTION_WARNING" ]] + """.trim() + } + } + + stage('Upload Chrome Extension for Serverless Workflow Editor') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "kie-tools/packages/chrome-extension-serverless-workflow-editor/dist/chrome_extension_serverless_workflow_editor_${params.TAG}.zip", + "chrome_extension_serverless_workflow_editor_${params.TAG}.zip", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Deploy Chrome Extension for Serverless Workflow Editor to GitHub Pages (kogito-online)') { + when { + expression { !params.DRY_RUN } + } + steps { + dir('kogito-online') { + script { + DEPLOYMENT_DIR = "swf-chrome-extension/${params.TAG}" + + sh """#!/bin/bash -el + git config --global user.email '[email protected]' + git config --global user.name 'KIE Tools Bot (kiegroup)' + git checkout gh-pages + + echo "Copy Chrome Extension resources" + rm -rf ${DEPLOYMENT_DIR} + mkdir -p ${DEPLOYMENT_DIR} + cp -r ${WORKSPACE}/kie-tools/packages/chrome-extension-serverless-workflow-editor/dist/{fonts,diagram,*-envelope.*,*.bundle.js,*.worker.js} ${DEPLOYMENT_DIR} + + echo "Commit changes and push" + git add . + git commit -m "Deploy ${params.TAG} (Chrome Extension for Serverless Workflow Editor)" + """.trim() + + withCredentials([usernamePassword(credentialsId: "${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', passwordVariable: 'GH_PASSWORD')]) { + sh('set +x && git push https://$GH_USER:[email protected]/kiegroup/kogito-online.git gh-pages') + } + } + } + } + } + + stage('Upload Chrome Extension for Serverless Workflow Editor to the Chrome Store') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + env.CHROME_EXTESION_SERVERLESS_WORKFLOW_EDITOR_UPLOAD_STATUS = chromeStoreUtils.uploadExtension( + "${pipelineVars.chromeStoreCredentialsId}", + "${pipelineVars.chromeStoreRefreshTokenCredentialsId}", + "kie-tools/packages/chrome-extension-serverless-workflow-editor/dist/chrome_extension_serverless_workflow_editor_${params.TAG}.zip", + 'EXTENSION_ID' + ) + } + } + } + + stage('Check Upload - Chrome Extension for Serverless Workflow Editor') { + when { + expression { !params.DRY_RUN } + } + steps { + sh """#!/bin/bash -el + [[ "${env.CHROME_EXTESION_SERVERLESS_WORKFLOW_EDITOR_UPLOAD_STATUS}" == "SUCCESS" ]] + """.trim() + } + } + + stage('Publish Chrome Extension for Serverless Workflow Editor for users') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + env.CHROME_EXTESION_SERVERLESS_WORKFLOW_EDITOR_PUBLISH_STATUS = chromeStoreUtils.publishExtension( + "${pipelineVars.chromeStoreCredentialsId}", + "${pipelineVars.chromeStoreRefreshTokenCredentialsId}", + 'EXTENSION_ID' + ) + } + } + } + + stage('Check Publish - Chrome Extension for Serverless Workflow Editor') { + when { + expression { !params.DRY_RUN } + } + steps { + sh """#!/bin/bash -el + [[ "${env.CHROME_EXTESION_SERVERLESS_WORKFLOW_EDITOR_PUBLISH_STATUS}" == "OK" ]] || [[ "${env.CHROME_EXTESION_SERVERLESS_WORKFLOW_EDITOR_PUBLISH_STATUS}" == "PUBLISHED_WITH_FRICTION_WARNING" ]] + """.trim() + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.cors-proxy b/.ci/jenkins/release-jobs/Jenkinsfile.cors-proxy new file mode 100644 index 0000000000..0166fb5bf8 --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.cors-proxy @@ -0,0 +1,167 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + OPENSHIFT_APP_NAME = 'cors-proxy' + OPENSHIFT_PART_OF = 'kie-sandbox-app' + OPENSHIFT_NAMESPACE = 'kie-sandbox' + + CORS_PROXY_IMAGE__imageRegistry = 'quay.io' + CORS_PROXY_IMAGE__imageAccount = 'kie-tools' + CORS_PROXY_IMAGE__imageName = 'cors-proxy-image' + CORS_PROXY_IMAGE__imageBuildTags = "latest ${params.TAG}" + + DOCKER_CONFIG = "${WORKSPACE}/.docker" + + PNPM_FILTER_STRING = '-F @kie-tools/cors-proxy-image...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + openShiftUtils = load '.ci/jenkins/shared-scripts/openShiftUtils.groovy' + dockerUtils = load '.ci/jenkins/shared-scripts/dockerUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Push cors-proxy-image to quay.io') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + dockerUtils.pushImageToRegistry( + "${env.CORS_PROXY_IMAGE__imageRegistry}/${env.CORS_PROXY_IMAGE__imageAccount}", + "${env.CORS_PROXY_IMAGE__imageName}", + "${env.CORS_PROXY_IMAGE__imageBuildTags}", + "${pipelineVars.quayPushCredentialsId}" + ) + } + } + } + + stage('Deploy cors-proxy-image to OpenShift') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + openShiftUtils.createOrUpdateApp( + "${env.OPENSHIFT_NAMESPACE}", + "${env.OPENSHIFT_APP_NAME}", + "${params.TAG}", + "${env.CORS_PROXY_IMAGE__imageRegistry}/${env.CORS_PROXY_IMAGE__imageAccount}/${env.CORS_PROXY_IMAGE__imageName}:${params.TAG}", + "${env.OPENSHIFT_PART_OF}", + 'nodejs', + "${pipelineVars.openshiftCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.dashbuilder-viewer-image b/.ci/jenkins/release-jobs/Jenkinsfile.dashbuilder-viewer-image new file mode 100644 index 0000000000..5b80a46446 --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.dashbuilder-viewer-image @@ -0,0 +1,143 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + DASHBUILDER__viewerImageRegistry = 'quay.io' + DASHBUILDER__viewerImageAccount = 'kie-tools' + DASHBUILDER__viewerImageName = 'dashbuilder-viewer-image' + DASHBUILDER__viewerImageBuildTags = "latest ${params.TAG}" + + DOCKER_CONFIG = "${WORKSPACE}/.docker" + + PNPM_FILTER_STRING = '-F @kie-tools/dashbuilder-viewer-image...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + dockerUtils = load '.ci/jenkins/shared-scripts/dockerUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Push dashbuilder-viewer-image to quay.io') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + dockerUtils.pushImageToRegistry( + "${env.DASHBUILDER__viewerImageRegistry}/${env.DASHBUILDER__viewerImageAccount}", + "${env.DASHBUILDER__viewerImageName}", + "${env.DASHBUILDER__viewerImageBuildTags}", + "${pipelineVars.quayPushCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.dmn-dev-deployment b/.ci/jenkins/release-jobs/Jenkinsfile.dmn-dev-deployment new file mode 100644 index 0000000000..505d06a55b --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.dmn-dev-deployment @@ -0,0 +1,147 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + DMN_DEV_DEPLOYMENT_BASE_IMAGE__registry = 'quay.io' + DMN_DEV_DEPLOYMENT_BASE_IMAGE__account = 'kie-tools' + DMN_DEV_DEPLOYMENT_BASE_IMAGE__name = 'dmn-dev-deployment-base-image' + DMN_DEV_DEPLOYMENT_BASE_IMAGE__buildTags = "latest ${params.TAG}" + ONLINE_EDITOR__dmnDevDeploymentBaseImageRegistry = 'quay.io' + ONLINE_EDITOR__dmnDevDeploymentBaseImageAccount = 'kie-tools' + ONLINE_EDITOR__dmnDevDeploymentBaseImageName = 'dmn-dev-deployment-base-image' + ONLINE_EDITOR__dmnDevDeploymentBaseImageTag = "${params.TAG}" + + DOCKER_CONFIG = "${WORKSPACE}/.docker" + + PNPM_FILTER_STRING = '-F @kie-tools/dmn-dev-deployment-base-image...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + dockerUtils = load '.ci/jenkins/shared-scripts/dockerUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Push dmn-dev-deployment-base-image to quay.io') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + dockerUtils.pushImageToRegistry( + "${env.DMN_DEV_DEPLOYMENT_BASE_IMAGE__registry}/${env.DMN_DEV_DEPLOYMENT_BASE_IMAGE__account}", + "${env.DMN_DEV_DEPLOYMENT_BASE_IMAGE__name}", + "${env.DMN_DEV_DEPLOYMENT_BASE_IMAGE__buildTags}", + "${pipelineVars.quayPushCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.extended-services b/.ci/jenkins/release-jobs/Jenkinsfile.extended-services new file mode 100644 index 0000000000..8679ea7fb8 --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.extended-services @@ -0,0 +1,133 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + string(description: 'Upload Asset Url', name: 'UPLOAD_ASSET_URL') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + PNPM_FILTER_STRING = '-F @kie-tools/extended-services...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + + stage('Setup PNPM') { + steps { + script { + buildUtils.setupPnpm() + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Upload Extended Services for Linux') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + 'packages/extended-services/dist/linux/kie_sandbox_extended_services.tar.gz', + "kie_sandbox_extended_services_linux_${params.TAG}.tar.gz", + 'application/tar+gzip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox b/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox new file mode 100644 index 0000000000..93b1529ca2 --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox @@ -0,0 +1,192 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + string(description: 'Kie Sandbox Extendend Services Url', name: 'KIE_SANDBOX_EXTENDED_SERVICES_URL') + string(description: 'Kie Sandbox Cors Proxy Url', name: 'KIE_SANDBOX_CORS_PROXY_URL') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + OPENSHIFT_APP_NAME = 'kie-sandbox' + OPENSHIFT_PART_OF = 'kie-sandbox-app' + OPENSHIFT_NAMESPACE = 'kie-sandbox' + + KIE_SANDBOX__imageRegistry = 'quay.io' + KIE_SANDBOX__imageAccount = 'kie-tools' + KIE_SANDBOX__imageName = 'kie-sandbox-image' + KIE_SANDBOX__imageBuildTags = "latest ${params.TAG}" + ONLINE_EDITOR__buildInfo = "${params.TAG}" + ONLINE_EDITOR__extendedServicesDownloadUrlLinux = "https://github.com/kiegroup/kie-tools/releases/download/${params.TAG}/kie_sandbox_extended_services_linux_${params.TAG}.tar.gz" + ONLINE_EDITOR__extendedServicesDownloadUrlMacOs = "https://github.com/kiegroup/kie-tools/releases/download/${params.TAG}/kie_sandbox_extended_services_macos_${params.TAG}.dmg" + ONLINE_EDITOR__extendedServicesDownloadUrlWindows = "https://github.com/kiegroup/kie-tools/releases/download/${params.TAG}/kie_sandbox_extended_services_windows_${params.TAG}.exe" + ONLINE_EDITOR__extendedServicesCompatibleVersion = "${params.TAG}" + ONLINE_EDITOR__dmnDevDeploymentBaseImageRegistry = 'quay.io' + ONLINE_EDITOR__dmnDevDeploymentBaseImageAccount = 'kie-tools' + ONLINE_EDITOR__dmnDevDeploymentBaseImageName = 'dmn-dev-deployment-base-image' + ONLINE_EDITOR__dmnDevDeploymentBaseImageTag = "${params.TAG}" + ONLINE_EDITOR__gtmId = 'GTM-PQGMKNW' + + DOCKER_CONFIG = "${WORKSPACE}/.docker" + + PNPM_FILTER_STRING = '-F @kie-tools/kie-sandbox-image...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + dockerUtils = load '.ci/jenkins/shared-scripts/dockerUtils.groovy' + openShiftUtils = load '.ci/jenkins/shared-scripts/openShiftUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Push kie-sandbox-image to quay.io') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + dockerUtils.pushImageToRegistry( + "${env.KIE_SANDBOX__imageRegistry}/${env.KIE_SANDBOX__imageAccount}", + "${env.KIE_SANDBOX__imageName}", + "${env.KIE_SANDBOX__imageBuildTags}", + "${pipelineVars.quayPushCredentialsId}" + ) + } + } + } + + stage('Prepare environment variables for OpenShift deployment') { + when { + expression { !params.DRY_RUN } + } + steps { + sh """#!/bin/bash -el + echo "KIE_SANDBOX_EXTENDED_SERVICES_URL=${params.KIE_SANDBOX_EXTENDED_SERVICES_URL}" >> deployment.env + echo "KIE_SANDBOX_CORS_PROXY_URL=${params.KIE_SANDBOX_CORS_PROXY_URL}" >> deployment.env + """.trim() + } + } + + stage('Deploy kie-sandbox-image to OpenShift') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + openShiftUtils.createOrUpdateApp( + "${env.OPENSHIFT_NAMESPACE}", + "${env.OPENSHIFT_APP_NAME}", + "${params.TAG}", + "${env.KIE_SANDBOX__imageRegistry}/${env.KIE_SANDBOX__imageAccount}/${env.KIE_SANDBOX__imageName}:${params.TAG}", + "${env.OPENSHIFT_PART_OF}", + 'js', + "${pipelineVars.openshiftCredentialsId}", + './deployment.env' + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox-extended-services b/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox-extended-services new file mode 100644 index 0000000000..27f75464fd --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.kie-sandbox-extended-services @@ -0,0 +1,167 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 240, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + OPENSHIFT_APP_NAME = 'kie-sandbox-extended-services' + OPENSHIFT_PART_OF = 'kie-sandbox-app' + OPENSHIFT_NAMESPACE = 'kie-sandbox' + + KIE_SANDBOX_EXTENDED_SERVICES__imageRegistry = 'quay.io' + KIE_SANDBOX_EXTENDED_SERVICES__imageAccount = 'kie-tools' + KIE_SANDBOX_EXTENDED_SERVICES__imageName = 'kie-sandbox-extended-services-image' + KIE_SANDBOX_EXTENDED_SERVICES__imageBuildTags = "latest ${params.TAG}" + + DOCKER_CONFIG = "${WORKSPACE}/.docker" + + PNPM_FILTER_STRING = '-F @kie-tools/kie-sandbox-extended-services-image...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + dockerUtils = load '.ci/jenkins/shared-scripts/dockerUtils.groovy' + openShiftUtils = load '.ci/jenkins/shared-scripts/openShiftUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Push kie-sandbox-extended-services-image to quay.io') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + dockerUtils.pushImageToRegistry( + "${env.KIE_SANDBOX_EXTENDED_SERVICES__imageRegistry}/${env.KIE_SANDBOX_EXTENDED_SERVICES__imageAccount}", + "${env.KIE_SANDBOX_EXTENDED_SERVICES__imageName}", + "${env.KIE_SANDBOX_EXTENDED_SERVICES__imageBuildTags}", + "${pipelineVars.quayPushCredentialsId}" + ) + } + } + } + + stage('Deploy kie-sandbox-extended-services-image to OpenShift') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + openShiftUtils.createOrUpdateApp( + "${env.OPENSHIFT_NAMESPACE}", + "${env.OPENSHIFT_APP_NAME}", + "${params.TAG}", + "${env.KIE_SANDBOX_EXTENDED_SERVICES__imageRegistry}/${env.KIE_SANDBOX_EXTENDED_SERVICES__imageAccount}/${env.KIE_SANDBOX_EXTENDED_SERVICES__imageName}:${params.TAG}", + "${env.OPENSHIFT_PART_OF}", + 'golang', + "${pipelineVars.openshiftCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.kn-plugin-workflow b/.ci/jenkins/release-jobs/Jenkinsfile.kn-plugin-workflow new file mode 100644 index 0000000000..11e8daf5df --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.kn-plugin-workflow @@ -0,0 +1,180 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + string(description: 'Upload Asset Url', name: 'UPLOAD_ASSET_URL') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + PNPM_FILTER_STRING = '-F @kie-tools/kn-plugin-workflow...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + + stage('Setup PNPM') { + steps { + script { + buildUtils.setupPnpm() + } + } + } + + stage('PNPM Bootstrap') { + steps { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + + stage('Build') { + steps { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + + stage('Upload Knative CLI Workflow Plugin for Linux') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + 'packages/kn-plugin-workflow/dist/kn-workflow-linux-amd64', + "kn-workflow-linux-amd64-${params.TAG}", + 'application/octet-stream', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Upload Knative CLI Workflow Plugin for macOS') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + 'packages/kn-plugin-workflow/dist/kn-workflow-darwin-amd64', + "kn-workflow-darwin-amd64-${params.TAG}", + 'application/octet-stream', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Upload Knative CLI Workflow Plugin for macOS M1') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + 'packages/kn-plugin-workflow/dist/kn-workflow-darwin-arm64', + "kn-workflow-darwin-arm64-${params.TAG}", + 'application/octet-stream', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Upload Knative CLI Workflow Plugin for Windows') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + 'packages/kn-plugin-workflow/dist/kn-workflow-windows-amd64.exe', + "kn-workflow-windows-amd64-${params.TAG}.exe", + 'application/octet-stream', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.npm-packages b/.ci/jenkins/release-jobs/Jenkinsfile.npm-packages new file mode 100644 index 0000000000..7692c551cf --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.npm-packages @@ -0,0 +1,137 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 90, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + + stage('Setup PNPM') { + steps { + script { + buildUtils.setupPnpm() + } + } + } + + stage('Create PNPM filter for building') { + steps { + script { + pnpmFilter = sh returnStdout: true, script:"""#!/bin/bash -el + PNPM_FILTER_STRING_FOR_BUILDING=\$(pnpm -r exec 'bash' '-c' 'PKG_NAME=\$(jq -r ".name" package.json) PKG_IS_PVT=\$(jq -r ".private" package.json); if [[ "\$PKG_IS_PVT" != "true" ]]; then echo "-F \$PKG_NAME..."; fi') + echo \$PNPM_FILTER_STRING_FOR_BUILDING + """.trim() + env.PNPM_FILTER_STRING_FOR_BUILDING = pnpmFilter.trim() + } + } + } + + stage('PNPM Bootstrap') { + steps { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING_FOR_BUILDING}") + } + } + } + + stage('Build') { + steps { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING_FOR_BUILDING}") + } + } + } + + stage('Publish packages to the NPM registry') { + when { + expression { !params.DRY_RUN } + } + steps { + withCredentials([string(credentialsId: "${pipelineVars.npmTokenCredentialsId}", variable: 'NPM_TOKEN')]) { + sh """#!/bin/bash -el + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + PNPM_FILTER_STRING_FOR_PUBLISHING=\$(pnpm -r exec 'bash' '-c' 'PKG_NAME=\$(jq -r ".name" package.json) PKG_IS_PVT=\$(jq -r ".private" package.json); if [[ "\$PKG_IS_PVT" != "true" ]]; then echo "-F \$PKG_NAME"; fi') + echo \$PNPM_FILTER_STRING_FOR_PUBLISHING + pnpm \$PNPM_FILTER_STRING_FOR_PUBLISHING exec 'bash' '-c' 'PKG_NAME=\$(jq -r ".name" package.json); NPM_PKG_INFO=\$(npm view \$PKG_NAME@${params.TAG} name || echo ""); if [[ -z \$NPM_PKG_INFO ]]; then pnpm publish --no-git-checks --access public; fi' + """.trim() + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.online-editor b/.ci/jenkins/release-jobs/Jenkinsfile.online-editor new file mode 100644 index 0000000000..84e5f35a1a --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.online-editor @@ -0,0 +1,195 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + ONLINE_EDITOR__buildInfo = "${params.TAG}" + ONLINE_EDITOR__extendedServicesDownloadUrlLinux = "https://github.com/kiegroup/kie-tools/releases/download/${params.TAG}/kie_sandbox_extended_services_linux_${params.TAG}.tar.gz" + ONLINE_EDITOR__extendedServicesDownloadUrlMacOs = "https://github.com/kiegroup/kie-tools/releases/download/${params.TAG}/kie_sandbox_extended_services_macos_${params.TAG}.dmg" + ONLINE_EDITOR__extendedServicesDownloadUrlWindows = "https://github.com/kiegroup/kie-tools/releases/download/${params.TAG}/kie_sandbox_extended_services_windows_${params.TAG}.exe" + ONLINE_EDITOR__extendedServicesCompatibleVersion = "${params.TAG}" + ONLINE_EDITOR__dmnDevDeploymentBaseImageRegistry = 'quay.io' + ONLINE_EDITOR__dmnDevDeploymentBaseImageAccount = 'kie-tools' + ONLINE_EDITOR__dmnDevDeploymentBaseImageName = 'dmn-dev-deployment-base-image' + ONLINE_EDITOR__dmnDevDeploymentBaseImageTag = "${params.TAG}" + ONLINE_EDITOR__gtmId = 'GTM-PQGMKNW' + ONLINE_EDITOR__corsProxyUrl = 'https://cors-proxy-kie-sandbox.rhba-0ad6762cc85bcef5745bb684498c2436-0000.us-south.containers.appdomain.cloud' + DMN_DEV_DEPLOYMENT_BASE_IMAGE__registry = 'quay.io' + DMN_DEV_DEPLOYMENT_BASE_IMAGE__account = 'kie-tools' + DMN_DEV_DEPLOYMENT_BASE_IMAGE__name = 'dmn-dev-deployment-base-image' + DMN_DEV_DEPLOYMENT_BASE_IMAGE__buildTags = "latest ${params.TAG}" + + PNPM_FILTER_STRING = '-F @kie-tools/online-editor...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Checkout kogito-online') { + steps { + dir('kogito-online') { + script { + githubUtils.checkoutRepo( + 'http://github.com/kiegroup/kogito-online.git', + 'gh-pages', + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Deploy to GitHub Pages (kogito-online)') { + when { + expression { !params.DRY_RUN } + } + steps { + dir('kogito-online') { + script { + EDITORS_DIR = "editors/${params.TAG}" + + sh """#!/bin/bash -el + git config --global user.email '[email protected]' + git config --global user.name 'KIE Tools Bot (kiegroup)' + git checkout gh-pages + + echo "Reset deployment dir" + shopt -s extglob + rm -rf -- !("dev"|"editors"|"standalone"|"chrome-extension"|"swf-chrome-extension"|".nojekyll"|"CNAME"|"0.23.0") + + echo "Copy Editor resources" + rm -rf ${EDITORS_DIR} + mkdir -p ${EDITORS_DIR} + cp -RL ${WORKSPACE}/kie-tools/packages/stunner-editors/dist/dmn ${EDITORS_DIR} + cp -RL ${WORKSPACE}/kie-tools/packages/stunner-editors/dist/bpmn ${EDITORS_DIR} + cp -RL ${WORKSPACE}/kie-tools/packages/stunner-editors/dist/scesim ${EDITORS_DIR} + rm -rf ./editors/latest + ln -s ${params.TAG} ./editors/latest + + echo "Copy Online Editor resources" + rm -rf ./gwt-editors + cp -r ${WORKSPACE}/kie-tools/packages/online-editor/dist/* . + rm -rf ./gwt-editors + ln -s ${EDITORS_DIR} gwt-editors + + echo "Commit changes and push" + git add . + git commit -m "Deploy ${params.TAG} (Editors + Online Editor)" + """.trim() + + withCredentials([usernamePassword(credentialsId: "${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', passwordVariable: 'GH_PASSWORD')]) { + sh('set +x && git push https://$GH_USER:[email protected]/kiegroup/kogito-online.git gh-pages') + } + } + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools new file mode 100644 index 0000000000..1656d5cdac --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools @@ -0,0 +1,184 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + SERVERLESS_LOGIC_WEB_TOOLS__version = "${params.TAG}" + SERVERLESS_LOGIC_WEB_TOOLS__samplesRepositoryRef = "${params.TAG}" + SERVERLESS_LOGIC_WEB_TOOLS__buildInfo = '' + SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageRegistry = 'quay.io' + SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageAccount = 'kie-tools' + SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageName = 'serverless-logic-web-tools-swf-builder-image' + SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageTag = "${params.TAG}" + SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageRegistry = 'quay.io' + SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageAccount = 'kie-tools' + SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageName = 'serverless-logic-web-tools-base-builder-image' + SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageTag = "${params.TAG}" + SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageRegistry = 'quay.io' + SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageAccount = 'kie-tools' + SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageName = 'serverless-logic-web-tools-swf-dev-mode-image' + SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageTag = "${params.TAG}" + DASHBUILDER__viewerImageRegistry = 'quay.io' + DASHBUILDER__viewerImageAccount = 'kie-tools' + DASHBUILDER__viewerImageName = 'dashbuilder-viewer-image' + SERVERLESS_LOGIC_WEB_TOOLS__dashbuilderViewerImageTag = "${params.TAG}" + SERVERLESS_LOGIC_WEB_TOOLS__corsProxyUrl = 'https://cors-proxy-kie-sandbox.rhba-0ad6762cc85bcef5745bb684498c2436-0000.us-south.containers.appdomain.cloud' + + PNPM_FILTER_STRING = '-F @kie-tools/serverless-logic-web-tools...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Checkout serverless-logic-sandbox-deployment') { + steps { + dir('serverless-logic-sandbox-deployment') { + script { + githubUtils.checkoutRepo( + 'http://github.com/kiegroup/serverless-logic-sandbox-deployment.git', + 'gh-pages', + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Deploy to GitHub Pages (serverless-logic-sandbox-deployment)') { + when { + expression { !params.DRY_RUN } + } + steps { + dir('serverless-logic-sandbox-deployment') { + script { + sh """#!/bin/bash -el + git config --global user.email '[email protected]' + git config --global user.name 'KIE Tools Bot (kiegroup)' + git checkout gh-pages + + echo "Reset deployment dir" + shopt -s extglob + rm -rf -- !("dev"|"staging"|".nojekyll"|"CNAME"|"0.25.0"|"schemas") + echo "Copy resources" + cp -r ${WORKSPACE}/kie-tools/packages/serverless-logic-web-tools/dist/* . + echo "Commit changes and push" + git add . + git commit -m "Deploy ${params.TAG}" + """.trim() + + withCredentials([usernamePassword(credentialsId: "${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', passwordVariable: 'GH_PASSWORD')]) { + sh('set +x && git push https://$GH_USER:[email protected]/kiegroup/serverless-logic-sandbox-deployment.git gh-pages') + } + } + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools-base-builder-image b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools-base-builder-image new file mode 100644 index 0000000000..ccf7977e43 --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools-base-builder-image @@ -0,0 +1,143 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageRegistry = 'quay.io' + SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageAccount = 'kie-tools' + SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageName = 'serverless-logic-web-tools-base-builder-image' + SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageBuildTags = "latest ${params.TAG}" + + DOCKER_CONFIG = "${WORKSPACE}/.docker" + + PNPM_FILTER_STRING = '-F @kie-tools/serverless-logic-web-tools-base-builder-image...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + dockerUtils = load '.ci/jenkins/shared-scripts/dockerUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Push serverless-logic-web-tools-base-builder-image to quay.io') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + dockerUtils.pushImageToRegistry( + "${env.SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageRegistry}/${env.SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageAccount}", + "${env.SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageName}", + "${env.SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageBuildTags}", + "${pipelineVars.quayPushCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools-swf-builder-image b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools-swf-builder-image new file mode 100644 index 0000000000..e151359406 --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools-swf-builder-image @@ -0,0 +1,143 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageRegistry = 'quay.io' + SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageAccount = 'kie-tools' + SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageName = 'serverless-logic-web-tools-swf-builder-image' + SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageBuildTags = "latest ${params.TAG}" + + DOCKER_CONFIG = "${WORKSPACE}/.docker" + + PNPM_FILTER_STRING = '-F @kie-tools/serverless-logic-web-tools-swf-builder-image...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + dockerUtils = load '.ci/jenkins/shared-scripts/dockerUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Push serverless-logic-web-tools-swf-builder-image to quay.io') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + dockerUtils.pushImageToRegistry( + "${env.SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageRegistry}/${env.SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageAccount}", + "${env.SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageName}", + "${env.SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageBuildTags}", + "${pipelineVars.quayPushCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools-swf-dev-mode-image b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools-swf-dev-mode-image new file mode 100644 index 0000000000..a66c14d5fe --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.serverless-logic-web-tools-swf-dev-mode-image @@ -0,0 +1,143 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageRegistry = 'quay.io' + SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageAccount = 'kie-tools' + SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageName = 'serverless-logic-web-tools-swf-dev-mode-image' + SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageBuildTags = "latest ${params.TAG}" + + DOCKER_CONFIG = "${WORKSPACE}/.docker" + + PNPM_FILTER_STRING = '-F @kie-tools/serverless-logic-web-tools-swf-dev-mode-image...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + dockerUtils = load '.ci/jenkins/shared-scripts/dockerUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Push serverless-logic-web-tools-swf-dev-mode-image to quay.io') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + dockerUtils.pushImageToRegistry( + "${env.SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageRegistry}/${env.SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageAccount}", + "${env.SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageName}", + "${env.SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageBuildTags}", + "${pipelineVars.quayPushCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.standalone-editors-cdn b/.ci/jenkins/release-jobs/Jenkinsfile.standalone-editors-cdn new file mode 100644 index 0000000000..3501877b34 --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.standalone-editors-cdn @@ -0,0 +1,173 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + PNPM_FILTER_STRING = '-F @kie-tools/kie-editors-standalone... -F @kie-tools/serverless-workflow-standalone-editor...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + dir('kie-tools') { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Checkout kogito-online') { + steps { + dir('kogito-online') { + script { + githubUtils.checkoutRepo( + 'http://github.com/kiegroup/kogito-online.git', + 'gh-pages', + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + } + + stage('Setup PNPM') { + steps { + dir('kie-tools') { + script { + buildUtils.setupPnpm() + } + } + } + } + + stage('PNPM Bootstrap') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Build') { + steps { + dir('kie-tools') { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + } + + stage('Deploy to GitHub Pages (kogito-online)') { + when { + expression { !params.DRY_RUN } + } + steps { + dir('kogito-online') { + script { + STANDALONE_EDITORS_DIR = "standalone/${params.TAG}" + + sh """#!/bin/bash -el + git config --global user.email '[email protected]' + git config --global user.name 'KIE Tools Bot (kiegroup)' + git checkout gh-pages + + echo "Copy standalone resources" + rm -rf ${STANDALONE_EDITORS_DIR} + mkdir -p ${STANDALONE_EDITORS_DIR}/bpmn ${STANDALONE_EDITORS_DIR}/dmn ${STANDALONE_EDITORS_DIR}/swf + cp ${WORKSPACE}/kie-tools/packages/kie-editors-standalone/dist/bpmn/index.js ${STANDALONE_EDITORS_DIR}/bpmn/ + cp ${WORKSPACE}/kie-tools/packages/kie-editors-standalone/dist/dmn/index.js ${STANDALONE_EDITORS_DIR}/dmn/ + cp ${WORKSPACE}/kie-tools/packages/serverless-workflow-standalone-editor/dist/swf/index.js ${STANDALONE_EDITORS_DIR}/swf/ + rm -f ./standalone/bpmn/index.js + rm -f ./standalone/dmn/index.js + rm -f ./standalone/swf/index.js + ln -s ../${params.TAG}/bpmn/index.js ./standalone/bpmn/index.js + ln -s ../${params.TAG}/dmn/index.js ./standalone/dmn/index.js + ln -s ../${params.TAG}/swf/index.js ./standalone/swf/index.js + + echo "Commit changes and push" + git add . + git commit -m "Deploy ${params.TAG} (Standalone Editors)" + """.trim() + + withCredentials([usernamePassword(credentialsId: "${pipelineVars.kieToolsBotGithubCredentialsId}", usernameVariable: 'GH_USER', passwordVariable: 'GH_PASSWORD')]) { + sh('set +x && git push https://$GH_USER:[email protected]/kiegroup/kogito-online.git gh-pages') + } + } + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.vscode-extensions-dev b/.ci/jenkins/release-jobs/Jenkinsfile.vscode-extensions-dev new file mode 100644 index 0000000000..05667e8837 --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.vscode-extensions-dev @@ -0,0 +1,129 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 120, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + string(description: 'Upload Asset Url', name: 'UPLOAD_ASSET_URL') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + + PNPM_FILTER_STRING = '-F kie-editors-dev-vscode-extension...' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + + stage('Setup PNPM') { + steps { + script { + buildUtils.setupPnpm() + } + } + } + + stage('PNPM Bootstrap') { + steps { + script { + buildUtils.pnpmBootstrap("${env.PNPM_FILTER_STRING}") + } + } + } + + stage('Build') { + steps { + script { + buildUtils.pnpmBuild("${env.PNPM_FILTER_STRING}") + } + } + } + + stage('Upload VS Code Extension (dev)') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "packages/kie-editors-dev-vscode-extension/dist/kie_editors_dev_vscode_extension_${params.TAG}.vsix", + "vscode_extension_dev_${params.TAG}.vsix", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} diff --git a/.ci/jenkins/release-jobs/Jenkinsfile.vscode-extensions-prod b/.ci/jenkins/release-jobs/Jenkinsfile.vscode-extensions-prod new file mode 100644 index 0000000000..bc89b6e8be --- /dev/null +++ b/.ci/jenkins/release-jobs/Jenkinsfile.vscode-extensions-prod @@ -0,0 +1,242 @@ +/* + * 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. + */ +pipeline { + agent { + docker { + image 'quay.io/kie-tools/kie-tools-ci-build:latest' + args '--shm-size=2g --privileged --group-add docker' + } + } + + options { + timeout(time: 120, unit: 'MINUTES') + } + + parameters { + booleanParam(description: 'Dry run', name: 'DRY_RUN', defaultValue: true) + string(description: 'Tag', name: 'TAG', defaultValue: '0.0.0') + string(description: 'Base Ref', name: 'BASE_REF') + string(description: 'Upload Asset Url', name: 'UPLOAD_ASSET_URL') + } + + environment { + KIE_TOOLS_BUILD__runLinters = 'false' + KIE_TOOLS_BUILD__runTests = 'false' + KIE_TOOLS_BUILD__runEndToEndTests = 'false' + KIE_TOOLS_BUILD__buildContainerImages = 'true' + } + + stages { + stage('Load local shared scripts') { + steps { + script { + pipelineVars = load '.ci/jenkins/shared-scripts/pipelineVars.groovy' + buildUtils = load '.ci/jenkins/shared-scripts/buildUtils.groovy' + githubUtils = load '.ci/jenkins/shared-scripts/githubUtils.groovy' + } + } + } + + stage('Start required services for build and tests (DinD, Xvfb, Fluxbox)') { + steps { + script { + buildUtils.startRequiredServices() + } + } + } + + stage('Clean workspace before build') { + steps { + cleanWs(deleteDirs: true, disableDeferredWipeout: true) + } + } + + stage('Checkout kie-tools') { + steps { + script { + githubUtils.checkoutRepo( + "http://github.com/${pipelineVars.githubRepositorySlug}.git", + "${params.BASE_REF}", + "${pipelineVars.kieToolsBotGithubCredentialsId}" + ) + } + } + } + + stage('Setup PNPM') { + steps { + script { + buildUtils.setupPnpm() + } + } + } + + stage('PNPM Bootstrap') { + steps { + sh '''#!/bin/bash -el + pnpm bootstrap -F bpmn-vscode-extension... \ + -F dmn-vscode-extension... \ + -F pmml-vscode-extension... \ + -F vscode-extension-kogito-bundle... \ + -F swf-vscode-extension... \ + -F vscode-extension-kie-ba-bundle... \ + -F vscode-extension-dashbuilder-editor... + '''.trim() + } + } + + stage('Build') { + steps { + sh '''#!/bin/bash -el + pnpm -F bpmn-vscode-extension... \ + -F dmn-vscode-extension... \ + -F pmml-vscode-extension... \ + -F vscode-extension-kogito-bundle... \ + -F swf-vscode-extension... \ + -F vscode-extension-kie-ba-bundle... \ + -F vscode-extension-dashbuilder-editor... \ + build:prod + '''.trim() + } + } + + stage('Upload VS Code Extension - BPMN Editor (prod)') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "packages/bpmn-vscode-extension/dist/bpmn_vscode_extension_${params.TAG}.vsix", + "bpmn_vscode_extension_${params.TAG}.vsix", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Upload VS Code Extension - DMN Editor (prod)') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "packages/dmn-vscode-extension/dist/dmn_vscode_extension_${params.TAG}.vsix", + "dmn_vscode_extension_${params.TAG}.vsix", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Upload VS Code Extension - PMML Editor (prod)') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "packages/pmml-vscode-extension/dist/pmml_vscode_extension_${params.TAG}.vsix", + "pmml_vscode_extension_${params.TAG}.vsix", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Upload VS Code Extension - Kogito Bundle (prod)') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "packages/vscode-extension-kogito-bundle/dist/vscode_extension_kogito_bundle_${params.TAG}.vsix", + "vscode_extension_kogito_bundle_${params.TAG}.vsix", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Upload VS Code Extension - KIE Business Automation Bundle (prod)') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "packages/vscode-extension-kie-ba-bundle/dist/vscode_extension_kie_ba_bundle_${params.TAG}.vsix", + "vscode_extension_kie_ba_bundle_${params.TAG}.vsix", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Upload VS Code Extension - Serverless Workflow Editor - KIE (prod)') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "packages/serverless-workflow-vscode-extension/dist/serverless_workflow_vscode_extension_${params.TAG}.vsix", + "serverless_workflow_vscode_extension_${params.TAG}.vsix", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + + stage('Upload VS Code Extension - Dashbuilder Editor (prod)') { + when { + expression { !params.DRY_RUN } + } + steps { + script { + githubUtils.uploadReleaseAsset( + "${params.UPLOAD_ASSET_URL}", + "packages/vscode-extension-dashbuilder-editor/dist/vscode_extension_dashbuilder_editor_${params.TAG}.vsix", + "vscode_extension_dashbuilder_editor_${params.TAG}.vsix", + 'application/zip', + "${pipelineVars.kieToolsBotGithubTokenCredentialsId}" + ) + } + } + } + } + + post { + always { + cleanWs(deleteDirs: true) + } + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
