Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use obal to git branch & commit + unify bump packages #254

Merged
merged 3 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
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
20 changes: 1 addition & 19 deletions bump_deb_packaging
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
#!/bin/bash -e

. settings

REMOTE_BRANCH=deb/${FOREMAN_VERSION}

cd "$PACKAGING_DIR"

git fetch $PACKAGING_GIT_REMOTE
git checkout -b deb/release-$PROJECT-$FULLVERSION $PACKAGING_GIT_REMOTE/$REMOTE_BRANCH

scripts/changelog.rb -v ${FULLVERSION/-rc/~rc}-1 -m "$FULLVERSION released" debian/*/*/changelog
git add debian/*/*/changelog

git commit -m "Release $FULLVERSION"

if [[ $PACKAGING_PR == true ]] ; then
git phr -m "Release $FULLVERSION" -b "$REMOTE_BRANCH"
else
git push $PACKAGING_GIT_REMOTE HEAD:$REMOTE_BRANCH
fi
./bump_packaging deb
40 changes: 40 additions & 0 deletions bump_packaging
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash -e

. settings

FLAVOR=$1

if [[ $FLAVOR != deb ]] && [[ $FLAVOR != rpm ]] ; then
echo "Usage: $0 [deb|rpm]" >&2
exit 1
fi

REMOTE_BRANCH="${FLAVOR}/${FOREMAN_VERSION}"
FULL_REMOTE_BRANCH="$PACKAGING_GIT_REMOTE/$REMOTE_BRANCH"

cd "$PACKAGING_DIR"

git fetch $PACKAGING_GIT_REMOTE
git checkout -b "${FLAVOR}/release-$PROJECT-$FULLVERSION" "${FULL_REMOTE_BRANCH}"

if [[ $FLAVOR == deb ]] ; then
scripts/changelog.rb -v "${FULLVERSION/-rc/~rc}-1" -m "$FULLVERSION released" debian/*/*/changelog
git add debian/*/*/changelog
else
if [[ $FULLVERSION == *-rc* ]]; then
PRERELEASE=${FULLVERSION##*-}
obal update --version "${FULLVERSION%%-rc*}" --prerelease "${PRERELEASE}" --release keep "${RPM_PACKAGES[@]}"
else
obal update --version "${FULLVERSION}" "${RPM_PACKAGES[@]}"
fi

git add "${RPM_PACKAGES[@]/#/packages\/${PROJECT}/}"
fi

git commit -m "Release $FULLVERSION"

if [[ $PACKAGING_PR == true ]] ; then
git phr -m "Release $FULLVERSION" -b "$REMOTE_BRANCH"
else
git push "$PACKAGING_GIT_REMOTE" "HEAD:$REMOTE_BRANCH"
fi
22 changes: 1 addition & 21 deletions bump_rpm_packaging
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
#!/bin/bash -e

. settings

REMOTE_BRANCH=rpm/${FOREMAN_VERSION}

cd "$PACKAGING_DIR"

git fetch $PACKAGING_GIT_REMOTE
git checkout -b rpm/release-$PROJECT-$FULLVERSION $PACKAGING_GIT_REMOTE/$REMOTE_BRANCH

if [[ $FULLVERSION == *-rc* ]]; then
PRERELEASE=${FULLVERSION##*-}
obal update --commit --version ${FULLVERSION%%-rc*} --prerelease ${PRERELEASE} --release keep $RPM_PACKAGES
else
obal update --commit --version $FULLVERSION $RPM_PACKAGES
fi

if [[ $PACKAGING_PR == true ]] ; then
git phr -m "Release $FULLVERSION" -b "$REMOTE_BRANCH"
else
git push $PACKAGING_GIT_REMOTE HEAD:$REMOTE_BRANCH
fi
./bump_packaging rpm
2 changes: 1 addition & 1 deletion releases/foreman/1.19/settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FULLGPGKEY="CE3159AAC3EC09E51614775446020A10694FA479"
FULLVERSION="1.19.1"
RPM_PACKAGES=foreman foreman-installer foreman-proxy foreman-selinux
RPM_PACKAGES=(foreman foreman-installer foreman-proxy foreman-selinux)
OSES="rhel7"
2 changes: 1 addition & 1 deletion releases/foreman/settings
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TAR_PROJECTS="foreman foreman-proxy foreman-installer foreman-selinux"
RPM_PACKAGES="foreman foreman-installer foreman-proxy foreman-release foreman-selinux"
RPM_PACKAGES=(foreman foreman-installer foreman-proxy foreman-release foreman-selinux)
KOJI_TAGS="foreman-@VERSION@-@OS@"
PACKAGING_SUBDIR="packages/foreman"
OSES="el8"
2 changes: 1 addition & 1 deletion releases/katello/settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RPM_PACKAGES="katello katello-repos rubygem-katello"
RPM_PACKAGES=(katello katello-repos rubygem-katello)
KOJI_TAGS="katello-@VERSION@-@OS@ katello-@VERSION@-thirdparty-candlepin-@OS@"
PACKAGING_SUBDIR="packages/katello"

Expand Down
2 changes: 1 addition & 1 deletion settings
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ GITHUB_NAMESPACE=theforeman
PACKAGING_DIR="$GIT_DIR/foreman-packaging"
PACKAGING_GIT_REMOTE=origin
TAR_PROJECTS=""
RPM_PACKAGES=""
RPM_PACKAGES=()
KOJI_CMD="${KOJI_CMD:-koji}"
KOJI_TAGS=""
KOJI_SSH_TARGET="[email protected]"
Expand Down