Skip to content
Closed
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
21 changes: 19 additions & 2 deletions hack/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,26 @@

set -euo pipefail

OPENSHIFT_CI=${OPENSHIFT_CI:-""}
E2E_RELEASE_BRANCH=${E2E_RELEASE_BRANCH:-""}
Comment on lines +5 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, I think the following has the same result

Suggested change
OPENSHIFT_CI=${OPENSHIFT_CI:-""}
E2E_RELEASE_BRANCH=${E2E_RELEASE_BRANCH:-""}
OPENSHIFT_CI=${OPENSHIFT_CI:-}
E2E_RELEASE_BRANCH=${E2E_RELEASE_BRANCH:-}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to leave it as is, to be honest. Feels more explicit to me and we have the same pattern in other places.

GIT_BRANCH_ARGS=""

if [ "$OPENSHIFT_CI" == "true" ]; then # detect ci environment there
E2E_RELEASE_BRANCH=${PULL_BASE_REF} # use target branch as E2E_RELEASE_BRANCH for handling backports correctly
fi;

if [ "$E2E_RELEASE_BRANCH" != "" ]; then
echo "cloning branch $E2E_RELEASE_BRANCH"
GIT_BRANCH_ARGS="--branch ${E2E_RELEASE_BRANCH} --single-branch"
fi;

unset GOFLAGS
tmp="$(mktemp -d)"

git clone "https://github.com/openshift/cluster-api-actuator-pkg.git" "$tmp"
pushd "$tmp"
git clone ${GIT_BRANCH_ARGS} --depth 1 "https://github.com/openshift/cluster-api-actuator-pkg.git" .
echo "git branch: $(git status -b -s)"
echo "latest git commit: $(git --no-pager log --oneline -1)"
popd

exec make -C "$tmp" test-e2e
exec make -C "$tmp" test-e2e