Skip to content
Open
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ On Fedora this can be installed:
dnf install python3-jenkins
```

GitHub CLI is required for creating pull requests during packaging updates. See the [installation instructions](https://cli.github.com/) for your platform.

For Redmine integration, python-redmine needs to be installed:

```sh
Expand Down Expand Up @@ -225,6 +227,8 @@ Settings can be customized in `settings.local`. The following settings are suppo
GIT_DIR=$HOME/dev # Projects are cloned here
GIT_REMOTE=upstream # Git remote for cloned projects
PACKAGING_PR=true # Create a PR in bump_{deb,rpm}_packaging
PACKAGING_FORK_REMOTE=origin # Git remote name for your foreman-packaging fork (defaults to your GitHub username)
GITHUB_USER=yourusername # Your GitHub username (defaults to your shell's username)
```

## Generating Stage Repository
Expand Down
14 changes: 12 additions & 2 deletions bump_packaging
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fi

REMOTE_BRANCH="${FLAVOR}/${FOREMAN_VERSION}"
FULL_REMOTE_BRANCH="$PACKAGING_GIT_REMOTE/$REMOTE_BRANCH"
FEATURE_BRANCH="${FLAVOR}/release-$PROJECT-$FULLVERSION"

if [[ $GIT_USE_WORKTREES == true ]] ; then
RELEASE_PACKAGING_DIR="${PACKAGING_DIR}/${FLAVOR}-$VERSION"
Expand All @@ -34,7 +35,7 @@ fi
cd "$RELEASE_PACKAGING_DIR"

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

if [[ $FLAVOR == deb ]] ; then
scripts/changelog.rb -v "${FULLVERSION/-rc/~rc}-1" -m "$FULLVERSION released" debian/*/*/changelog
Expand All @@ -53,7 +54,16 @@ fi
git commit -m "Release $FULLVERSION"

if [[ $PACKAGING_PR == true ]] ; then
git phr -m "Release $FULLVERSION" -b "$REMOTE_BRANCH"
# Ensure fork exists with configured remote name
GH_PROMPT_DISABLED=1 gh repo fork theforeman/foreman-packaging --remote-name "$PACKAGING_FORK_REMOTE"

git push --set-upstream "$PACKAGING_FORK_REMOTE" HEAD

gh pr create --repo theforeman/foreman-packaging \
--title "${FLAVOR^^}: Release ${PROJECT^} $FULLVERSION" \
--head "$GITHUB_USER:$FEATURE_BRANCH" \
--base "$REMOTE_BRANCH" \
--body "Release ${PROJECT^} $FULLVERSION"
else
git push "$PACKAGING_GIT_REMOTE" "HEAD:$REMOTE_BRANCH"
fi
2 changes: 2 additions & 0 deletions settings
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ GIT_PROTOCOL="${GIT_PROTOCOL:-https}"
GIT_DEVELOP_BRANCH=develop
GIT_STABLE_BRANCH="${VERSION}-stable"
GITHUB_NAMESPACE=theforeman
GITHUB_USER="${GITHUB_USER:-$USER}"
PACKAGING_DIR="$GIT_DIR/foreman-packaging"
PACKAGING_GIT_REMOTE=origin
PACKAGING_FORK_REMOTE="${PACKAGING_FORK_REMOTE:-${GITHUB_USER}}"
TFM_WEBSITE_GH_PAGES_BRANCH=gh-pages
TAR_PROJECTS=""
RPM_PACKAGES=()
Expand Down