From: Don Zickus <dzickus(a)redhat.com>
As a step towards switching away from the os-build branch start by
using more variables.
The patch does 2 things:
* adds a use of PROJECT_ID
* replace os-build with BRANCH in the update configs script
Signed-off-by: Don Zickus <dzickus(a)redhat.com>
---
redhat/scripts/ci/ark-create-release.sh | 2 +-
redhat/scripts/ci/ark-update-configs.sh | 17 +++++++++++------
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/redhat/scripts/ci/ark-create-release.sh
b/redhat/scripts/ci/ark-create-release.sh
index 8b3b414be953..df501b0cce56 100755
--- a/redhat/scripts/ci/ark-create-release.sh
+++ b/redhat/scripts/ci/ark-create-release.sh
@@ -47,7 +47,7 @@ else
fi
git merge -m "Merge configuration and build scripts" os-build
-MR_PATCHES=$(gitlab project-merge-request list --project-id=13604247 \
+MR_PATCHES=$(gitlab project-merge-request list --project-id=${PROJECT_ID} \
--labels="Include in Releases" --state=opened | grep -v "^$" | sort
| \
awk '{ print "https://gitlab.com/cki-project/kernel-ark/-/merge_requests/"
$2 ".patch" }')
for patch_url in $MR_PATCHES; do
diff --git a/redhat/scripts/ci/ark-update-configs.sh
b/redhat/scripts/ci/ark-update-configs.sh
index 1669abe1ae89..e0945d5ffbb4 100755
--- a/redhat/scripts/ci/ark-update-configs.sh
+++ b/redhat/scripts/ci/ark-update-configs.sh
@@ -1,15 +1,15 @@
#!/bin/bash
#
-# This script is intended to regularly update the os-build branch with the latest
+# This script is intended to regularly update the $BRANCH branch with the latest
# configuration options from upstream. It merges the given reference into
-# os-build, adds all new configuration symbols to the pending/ config directory,
+# $BRANCH, adds all new configuration symbols to the pending/ config directory,
# and creates a branch for each new config group.
#
# If the upstream branch fails to merge and the REPORT_BUGS environment variable
# is set, an issue is filed against the provided project ID.
#
# Arguments:
-# 1) The git object to merge into os-build. This should be something from
+# 1) The git object to merge into $BRANCH. This should be something from
# Linus's master branch, usually either a tag such as v5.5-rc3 or just
# linus/master. The default is "master".
# 2) The Gitlab project ID to file issues against. See the project page on
@@ -32,14 +32,15 @@ To resolve this, do the following:
"
git checkout os-build
-if ! git merge -m "Merge '$UPSTREAM_REF' into 'os-build'"
"$UPSTREAM_REF"; then
+BRANCH="$(git branch --show-current)"
+if ! git merge -m "Merge '$UPSTREAM_REF' into '$BRANCH'"
"$UPSTREAM_REF"; then
git merge --abort
printf "Merge conflict; halting!\n"
if [ -n "$REPORT_BUGS" ]; then
ISSUES=$(gitlab project-issue list --state "opened" --labels
"Configuration Update" --project-id "$PROJECT_ID")
if [ -z "$ISSUES" ]; then
gitlab project-issue create --project-id "$PROJECT_ID" \
- --title "Merge conflict between '$UPSTREAM_REF' and
'os-build'" \
+ --title "Merge conflict between '$UPSTREAM_REF' and
'$BRANCH'" \
--labels "Configuration Update" \
--description "$ISSUE_DESCRIPTION"
fi
@@ -47,11 +48,15 @@ if ! git merge -m "Merge '$UPSTREAM_REF' into
'os-build'" "$UPSTREAM_REF"; then
exit 1
fi
+# Generates and commits all the pending configs
make FLAVOR=fedora dist-configs-commit
make FLAVOR=rhel dist-configs-commit
+# Converts each new pending config from above into its finalized git
+# configs/<date>/<config> branch. These commits are used for Merge
+# Requests.
if git show -s --oneline HEAD | grep -q "AUTOMATIC: New configs"; then
./redhat/gen_config_patches.sh
else
- printf "No new configuration values exposed from merging %s into os-build\n"
"$UPSTREAM_REF"
+ printf "No new configuration values exposed from merging %s into $BRANCH\n"
"$UPSTREAM_REF"
fi
--
GitLab