diff --git a/bump_deb_packaging b/bump_deb_packaging index 5a2d8cf..4d46803 100755 --- a/bump_deb_packaging +++ b/bump_deb_packaging @@ -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 diff --git a/bump_packaging b/bump_packaging new file mode 100755 index 0000000..52f20b1 --- /dev/null +++ b/bump_packaging @@ -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 diff --git a/bump_rpm_packaging b/bump_rpm_packaging index a63de19..9a38fa2 100755 --- a/bump_rpm_packaging +++ b/bump_rpm_packaging @@ -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 diff --git a/releases/foreman/1.19/settings b/releases/foreman/1.19/settings index fda3bbb..091b478 100644 --- a/releases/foreman/1.19/settings +++ b/releases/foreman/1.19/settings @@ -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" diff --git a/releases/foreman/settings b/releases/foreman/settings index f4f46be..19c377f 100644 --- a/releases/foreman/settings +++ b/releases/foreman/settings @@ -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" diff --git a/releases/katello/settings b/releases/katello/settings index 16db4db..9f8a3db 100644 --- a/releases/katello/settings +++ b/releases/katello/settings @@ -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" diff --git a/settings b/settings index 45fb25b..514b0d7 100644 --- a/settings +++ b/settings @@ -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="root@koji.katello.org"