-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |