|
@@ -2,6 +2,8 @@
|
|
set -o errexit -o pipefail
|
|
set -o errexit -o pipefail
|
|
DIR=$(dirname "${0}")
|
|
DIR=$(dirname "${0}")
|
|
MAIN_DIR=$(readlink -f "${DIR}/..")
|
|
MAIN_DIR=$(readlink -f "${DIR}/..")
|
|
|
|
+# GIT_DIR to support workdirs/worktrees
|
|
|
|
+GIT_DIR="$(dirname "$(realpath "${MAIN_DIR}/.git/config")")"
|
|
# shellcheck disable=SC2016
|
|
# shellcheck disable=SC2016
|
|
IMAGE=$(grep ^image: "${MAIN_DIR}/.gitlab-ci.yml" | \
|
|
IMAGE=$(grep ^image: "${MAIN_DIR}/.gitlab-ci.yml" | \
|
|
sed -e 's,^image: ,,g' | sed -e 's,\$CI_REGISTRY,registry.gitlab.com,g')
|
|
sed -e 's,^image: ,,g' | sed -e 's,\$CI_REGISTRY,registry.gitlab.com,g')
|
|
@@ -11,6 +13,7 @@ declare -a docker_opts=(
|
|
--rm
|
|
--rm
|
|
--user "$(id -u):$(id -g)"
|
|
--user "$(id -u):$(id -g)"
|
|
--mount "type=bind,src=${MAIN_DIR},dst=${MAIN_DIR}"
|
|
--mount "type=bind,src=${MAIN_DIR},dst=${MAIN_DIR}"
|
|
|
|
+ --mount "type=bind,src=${GIT_DIR},dst=${GIT_DIR}"
|
|
--workdir "${MAIN_DIR}"
|
|
--workdir "${MAIN_DIR}"
|
|
)
|
|
)
|
|
if tty -s; then
|
|
if tty -s; then
|