Skip to content

Commit

Permalink
Bring in changes from monitoring 19.x.x rebase
Browse files Browse the repository at this point in the history
Bring in the changes in #1567 that came from Jack testing the scripts out.
  • Loading branch information
Arvind Iyengar committed Oct 25, 2021
1 parent c26fc74 commit 5024871
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/rebase
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cd $(dirname $0)

cd ..

if [ -z ${PACKAGE} ] || [ -z ${NEW_TAG} ]; then
if [ -z "${PACKAGE}" ] || [ -z ${NEW_TAG} ]; then
echo "Usage: PACKAGE=<package-name> NEW_TAG=<tag-or-commit-in-upstream> ./scripts/rebase"
exit 1
fi
Expand Down Expand Up @@ -230,7 +230,7 @@ for commit in ${COMMITS}; do
git subtree split -P ${SUB_DIRECTORY} -b ${SUB_DIRECTORY_BRANCH} --annotate='(split) ' --rejoin 1>/dev/null 2>/dev/null
echo "Successfully re-aligned subdirectory branch. Resuming rebase..."
fi

# Pull in changes from subdirectory branch
git checkout ${STAGING_BRANCH} 1>/dev/null 2>/dev/null
set +e
Expand All @@ -251,7 +251,10 @@ for commit in ${COMMITS}; do
mkdir -p ${EXCLUDE_DIRECTORY}/${d}
done
for f in ${EXCLUDE_FILES}; do
mv ${DEST_DIRECTORY}/${f} ${EXCLUDE_DIRECTORY}/${f}
# the file might be removed by the commit
if [ -f ${DEST_DIRECTORY}/${f} ]; then
mv ${DEST_DIRECTORY}/${f} ${EXCLUDE_DIRECTORY}/${f}
fi
done
unset EXCLUDE_DIRECTORIES
unset EXCLUDE_FILES
Expand All @@ -261,7 +264,7 @@ for commit in ${COMMITS}; do
git reset HEAD~1 1>/dev/null 2>/dev/null
mv ${DEST_DIRECTORY}/crds ${CRD_CHART_DIRECTORY}/${CRDS_DIRECTORY}
fi

# Clean up empty directories from the merge
find . -type d -empty -delete 1>/dev/null 2>/dev/null

Expand Down

0 comments on commit 5024871

Please sign in to comment.