Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions scripts/auto-rebase/rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,28 @@ replace_using_component_commit() {
fi
}

# Updates a script to record the last rebase that was run to make it
# easier to reproduce issues and to test changes to the rebase script
# against the same set of images.
update_last_rebase() {
local release_image_amd64=$1
local release_image_arm64=$2

title "## updating last_rebase.sh"

local last_rebase_script="${REPOROOT}/scripts/auto-rebase/last_rebase.sh"

cat - >"${last_rebase_script}" <<EOF
#!/bin/bash -x
./scripts/auto-rebase/rebase.sh to "${release_image_amd64}" "${release_image_arm64}"
EOF
chmod +x "${last_rebase_script}"

(cd "${REPOROOT}" && \
git add scripts/auto-rebase/last_rebase.sh && \
git commit -m "update last_rebase.sh")
}

# Updates the ReplaceDirective for an old ${modulepath} with the new modulepath
# and version as per the staged checkout of ${component}.
update_modulepath_version_from_release() {
Expand Down Expand Up @@ -646,6 +668,8 @@ rebase_to() {
git branch -D "${rebase_branch}" || true
git checkout -b "${rebase_branch}"

update_last_rebase "${release_image_amd64}" "${release_image_arm64}"

update_go_mod
go mod tidy
if [[ -n "$(git status -s go.mod go.sum)" ]]; then
Expand Down