From 98106023a291fcfc75fd6d5f28105f7758585101 Mon Sep 17 00:00:00 2001 From: radtriste Date: Thu, 27 Jul 2023 11:03:20 +0200 Subject: [PATCH 1/2] Setup quarkus-lts patch --- .ci/environments/README.md | 3 ++ .ci/environments/quarkus-lts/README.md | 19 ++++++++++ .ci/environments/update.sh | 48 ++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 .ci/environments/README.md create mode 100644 .ci/environments/quarkus-lts/README.md create mode 100755 .ci/environments/update.sh diff --git a/.ci/environments/README.md b/.ci/environments/README.md new file mode 100644 index 000000000..b77102391 --- /dev/null +++ b/.ci/environments/README.md @@ -0,0 +1,3 @@ +# Environments CI scripts + +This folder contains update scripts which would be called for a specific environments. diff --git a/.ci/environments/quarkus-lts/README.md b/.ci/environments/quarkus-lts/README.md new file mode 100644 index 000000000..2c8fd03bf --- /dev/null +++ b/.ci/environments/quarkus-lts/README.md @@ -0,0 +1,19 @@ +# How to create a patch from a revert commit ? + +**NOTE:** Execute those commands at the root of your project + +First, set the variables to be used (change the values): + +``` bash +commit_id={COMMIT_HASH} +patch_name={ANY_MEANINGFUL_NAME} +``` + +Finally, create the patch file: + +``` bash +git revert --no-commit ${commit_id} +git commit -m "Revert ${patch_name}" +git show $(git rev-parse HEAD) > .ci/environments/quarkus-lts/patches/${patch_name} +git reset HEAD~1 --hard +``` diff --git a/.ci/environments/update.sh b/.ci/environments/update.sh new file mode 100755 index 000000000..bda16c4ef --- /dev/null +++ b/.ci/environments/update.sh @@ -0,0 +1,48 @@ +#!/bin/bash +set -euo pipefail + +script_dir_path=$(cd `dirname "${BASH_SOURCE[0]}"`; pwd -P) + +environment=$1 +shift + +if [ -z "${environment}" ]; then + echo "No environment given as first argument" + exit 1 +fi + +env_path="${script_dir_path}/${environment}" +echo $env_path +if [ ! -d "${env_path}" ]; then + echo "No configuration given for this environment ... Nothing done !" + exit 0 +fi + +echo "Update project for environment '${environment}'" + +# If update script is present, apply it +if [ -f "${env_path}/before.sh" ]; then + echo "Run before script" + ${env_path}/before.sh $@ +fi + +# Apply patches if any +patches_path="${env_path}"/patches +if [ -d ${patches_path} ]; then + for patch_file in "${patches_path}"/* + do + echo "Apply git patch ${patch_file}" + git apply ${patch_file} --whitespace=fix + done +else + echo 'No patch to apply' +fi + +# If update script is present, apply it +if [ -f "${env_path}/after.sh" ]; then + echo "Run after script" + ${env_path}/after.sh $@ +fi + +# Download `setup_integration_branch` script and execute +curl -s https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/dsl/seed/scripts/setup_integration_branch.sh | bash \ No newline at end of file From 30c99a9c63237e99e0fd25c73624e7ce10c22aaf Mon Sep 17 00:00:00 2001 From: radtriste Date: Thu, 27 Jul 2023 11:04:09 +0200 Subject: [PATCH 2/2] added patch --- .../0001_setup_kogito_version_to_extensions.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .ci/environments/quarkus-lts/patches/0001_setup_kogito_version_to_extensions.patch diff --git a/.ci/environments/quarkus-lts/patches/0001_setup_kogito_version_to_extensions.patch b/.ci/environments/quarkus-lts/patches/0001_setup_kogito_version_to_extensions.patch new file mode 100644 index 000000000..8145f513b --- /dev/null +++ b/.ci/environments/quarkus-lts/patches/0001_setup_kogito_version_to_extensions.patch @@ -0,0 +1,10 @@ +diff --git a/modules/kogito-swf/devmode/build-config/module.yaml b/modules/kogito-swf/devmode/build-config/module.yaml +index 5c72abf3..ed171a73 100644 +--- a/modules/kogito-swf/devmode/build-config/module.yaml ++++ b/modules/kogito-swf/devmode/build-config/module.yaml +@@ -9,4 +9,4 @@ envs: + - name: QUARKUS_EXTENSIONS + # NOTE: If you change the QUARKUS_EXTENSIONS value remember to update the scripts/logic/build-quarkus-app.sh too! + # Follow up issue to remove KOGITO_VERSION: https://issues.redhat.com/browse/KOGITO-9270 +- value: kogito-quarkus-serverless-workflow,kogito-addons-quarkus-knative-eventing,smallrye-health,kogito-quarkus-serverless-workflow-devui,kogito-addons-quarkus-source-files,kogito-addons-quarkus-jobs-service-embedded,kogito-addons-quarkus-data-index-inmemory,org.kie.kogito:kogito-addons-quarkus-fabric8-kubernetes-service-catalog:${KOGITO_VERSION},org.kie.kogito:kogito-addons-quarkus-kubernetes:${KOGITO_VERSION} ++ value: kogito-quarkus-serverless-workflow,kogito-addons-quarkus-knative-eventing,smallrye-health,kogito-quarkus-serverless-workflow-devui,kogito-addons-quarkus-source-files,org.kie.kogito:kogito-addons-quarkus-jobs-service-embedded:${KOGITO_VERSION},org.kie.kogito:kogito-addons-quarkus-data-index-inmemory:${KOGITO_VERSION},org.kie.kogito:kogito-addons-quarkus-fabric8-kubernetes-service-catalog:${KOGITO_VERSION},org.kie.kogito:kogito-addons-quarkus-kubernetes:${KOGITO_VERSION}