Commit 8b857769 authored by Alessio Caiazza's avatar Alessio Caiazza

Override WORKHORSE_URL to check security mirror

With the vendoring of workhorse, our CI checks if the content of
/workhorse matches the workhorse repository tagged with
/GITLAB_WORKHORSE_VERSION.

During a security release, this check may fail because the repository is
hardcoded.

With this commit we override such value with the environment variable
GITLAB_WORKHORSE_URL that is already in use in our RSpec suite.
parent c8202729
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
set -e set -e
WORKHORSE_DIR=workhorse/ WORKHORSE_DIR=workhorse/
WORKHORSE_REF="v$(cat GITLAB_WORKHORSE_VERSION)" WORKHORSE_REF="v$(cat GITLAB_WORKHORSE_VERSION)"
WORKHORSE_URL=${GITLAB_WORKHORSE_URL:-https://gitlab.com/gitlab-org/gitlab-workhorse.git}
if [ $# -gt 1 ] || ([ $# = 1 ] && [ x$1 != xcheck ]); then if [ $# -gt 1 ] || ([ $# = 1 ] && [ x$1 != xcheck ]); then
echo "Usage: update-workhorse [check]" echo "Usage: update-workhorse [check]"
...@@ -15,7 +16,7 @@ if [ -n "$clean" ] ; then ...@@ -15,7 +16,7 @@ if [ -n "$clean" ] ; then
exit 1 exit 1
fi fi
git fetch https://gitlab.com/gitlab-org/gitlab-workhorse.git "$WORKHORSE_REF" git fetch "$WORKHORSE_URL" "$WORKHORSE_REF"
git rm -rf --quiet -- "$WORKHORSE_DIR" git rm -rf --quiet -- "$WORKHORSE_DIR"
git read-tree --prefix="$WORKHORSE_DIR" -u FETCH_HEAD git read-tree --prefix="$WORKHORSE_DIR" -u FETCH_HEAD
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment