Skip to content

Commit

Permalink
Setup quarkus-lts patch
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Jul 27, 2023
1 parent df75994 commit 9810602
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .ci/environments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Environments CI scripts

This folder contains update scripts which would be called for a specific environments.
19 changes: 19 additions & 0 deletions .ci/environments/quarkus-lts/README.md
Original file line number Diff line number Diff line change
@@ -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
```
48 changes: 48 additions & 0 deletions .ci/environments/update.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9810602

Please sign in to comment.