Skip to content

Commit

Permalink
Merge pull request sigstore#39 from lance/tweak-sync-script
Browse files Browse the repository at this point in the history
chore: modify update script to avoid merge conflicts
  • Loading branch information
openshift-ci[bot] authored Oct 11, 2023
2 parents 3447abc + 6198737 commit d4994d3
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions redhat/release/update-to-head.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ robot_trigger_msg=":robot: triggering CI on branch '${redhat_ref}' after synchin
# Reset release-next to upstream main or <git-ref>.
git fetch upstream $upstream_ref
if [[ "$upstream_ref" == "main" ]]; then
git checkout upstream/main -B ${redhat_ref}
git checkout upstream/main -B ${redhat_ref}-ci
else
git checkout $upstream_ref -B ${redhat_ref}
git checkout $upstream_ref -B ${redhat_ref}-ci
fi

# RHTAP writes its pipeline files to the root of ${redhat_ref}
# Fetch those from origin and merge them into the the ci branch
git fetch origin $redhat_ref
git merge origin/$redhat_ref --no-edit

# Update redhat's main and take all needed files from there.
git fetch origin $midstream_ref
git checkout origin/$midstream_ref $custom_files
Expand All @@ -67,24 +72,16 @@ if [[ -d redhat/patches ]]; then
git apply redhat/patches/*
fi

# RHTAP writes its pipeline files to the root of ${redhat_ref}
# Fetch those from origin and apply them to the the release branch
# since we just wiped out our local copy with the upstream ref.
git fetch origin $redhat_ref
git checkout origin/$redhat_ref .tekton

# Move overlays to root
if [[ -d redhat/overlays ]]; then
git mv redhat/overlays/* .
mv redhat/overlays/* .
fi

git add . # Adds applied patches
git add $custom_files # Adds custom files
git commit -m "${redhat_files_msg}"

# Trigger CI
# TODO: Set up openshift or github CI to run on release-next-ci
git checkout "${redhat_ref}" -B "${redhat_ref}"-ci
date > ci
git add ci
git commit -m "${robot_trigger_msg}"
Expand Down

0 comments on commit d4994d3

Please sign in to comment.