This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
ci: sidecar images updates will be also created for latest bugfix branch #434
Closed
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -72,4 +72,5 @@ jobs: | |
git config --global user.name "Mykhailo Kuznietsov" | ||
git config --global user.email "[email protected]" | ||
export GITHUB_TOKEN=${{ secrets.CHE_BOT_GITHUB_TOKEN }} | ||
./arbitrary-users-patch/check_sidecar_image_digests.sh | ||
BUGFIX_BRANCH="$(git branch -a | grep "remotes/origin/7.*" | cut -d '/' -f 3 | sort --version-sort | tail -n1)" | ||
./arbitrary-users-patch/check_sidecar_image_digests.sh --bugfix-branch ${BUGFIX_BRANCH} |
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 |
---|---|---|
|
@@ -15,9 +15,11 @@ | |
set -e | ||
|
||
NO_OP="false" | ||
BUGFIX_BRANCH="" | ||
while [[ "$#" -gt 0 ]]; do | ||
case $1 in | ||
'-n'|'--no-op') NO_OP="true"; shift 0;; | ||
'-bb'|'--bugfix-branch') BUGFIX_BRANCH=$2; shift 1;; | ||
esac | ||
shift 1 | ||
done | ||
|
@@ -36,18 +38,27 @@ createPR() { | |
set +e | ||
PR_BRANCH="$1" | ||
|
||
COMMIT_MSG="[update] Update digests in base_images" | ||
COMMIT_MSG="chore: Update digests in base_images" | ||
nickboldt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# commit change into branch | ||
git add "${SCRIPT_DIR}"/base_images | ||
git commit -sm "${COMMIT_MSG}" | ||
|
||
git branch "${PR_BRANCH}" | ||
git checkout "${PR_BRANCH}" | ||
git checkout "${PR_BRANCH}" | ||
git pull origin "${PR_BRANCH}" | ||
git push origin "${PR_BRANCH}" | ||
lastCommitComment="$(git log -1 --pretty=%B)" | ||
|
||
hub pull-request -f -m "${lastCommitComment}" -b "${MAIN_BRANCH}" -h "${PR_BRANCH}" | ||
|
||
if [[ ! -z ${BUGFIX_BRANCH} ]]; then | ||
lastCommitId="$(git log --format=\"%H\" -n 1)" | ||
git checkout ${BUGFIX_BRANCH} | ||
git branch "${PR_BRANCH}-bugfix-branch" | ||
git checkout -b "${PR_BRANCH}-bugfix-branch" | ||
hub pull-request -f -m "${lastCommitComment}" -b "${MAIN_BRANCH}" -h "${PR_BRANCH}-bugfix-branch" | ||
fi | ||
set -e | ||
} | ||
|
||
|
@@ -77,6 +88,7 @@ if [[ $(git diff --exit-code "${SCRIPT_DIR}"/base_images) ]]; then | |
else | ||
echo "[INFO] Changes detected, generating PR with new digests" | ||
createPR "new-base-image-digests" | ||
create | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops |
||
fi | ||
else | ||
echo "[INFO] No changes detected for digests, do nothing" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if a topic branch is created called 7.32.x-some-reason? will that be used instead of 7.32.x ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I should add protection from that