Skip to content

Commit 59fe4dc

Browse files
Merge pull request #314 from rhmdnd/add-remote-detection-to-release-process
Use remote detection in release process
2 parents 20eea34 + 0d3eb6e commit 59fe4dc

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ endif
2626

2727
# Git options.
2828
GIT_OPTS?=
29-
# Set this to the remote used for the upstream repo (for release). Use an
30-
# absolute reference since we don't know if origin is the contributor's fork or
31-
# if it's the upstream repository.
32-
GIT_REMOTE?=git@github.com:openshift/file-integrity-operator.git
29+
# Set this to the remote used for the upstream repo (for release). Different
30+
# maintainers might use different names for the upstream repository. Since our
31+
# release process expects maintainers to propose release patches directly to
32+
# the upstream repository, let's make sure we're proposing it to the right one.
33+
# We rely on a bash script for this since it's simplier than interating over a
34+
# list with conditionals in GNU make.
35+
GIT_REMOTE?=$(shell ./utils/git-remote.sh)
3336

3437
# Image tag to use. Set this if you want to use a specific tag for building
3538
# or your e2e tests.

utils/git-remote.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# git-remote.sh prints the remote associated with the upstream
4+
# openshift/file-integrity-operator repository. If it can't determine the
5+
# appropriate remote based on a known URL, it defaults to using "origin", which
6+
# is backwards compatible with the release process.
7+
8+
REMOTE_URL=origin
9+
for REMOTE in `git remote`; do
10+
URL=`git config --get remote.$REMOTE.url`
11+
if [[ "$URL" = "https://github.com/openshift/file-integrity-operator" ]]; then
12+
REMOTE_URL=$REMOTE
13+
break
14+
fi
15+
done
16+
echo $REMOTE_URL

0 commit comments

Comments
 (0)