You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
437 B
14 lines
437 B
2 years ago
|
#!/usr/bin/env bash
|
||
|
set -o errexit -o pipefail
|
||
|
DIR=$(dirname "${0}")
|
||
|
MAIN_DIR=$(readlink -f "${DIR}/..")
|
||
|
# shellcheck disable=SC2016
|
||
|
IMAGE=$(grep ^image: "${MAIN_DIR}/.gitlab-ci.yml" | \
|
||
|
sed -e 's,^image: ,,g' | sed -e 's,\$CI_REGISTRY,registry.gitlab.com,g')
|
||
|
|
||
|
exec docker run -it --rm \
|
||
|
--user $(id -u):$(id -g) \
|
||
|
--mount "type=bind,src=${MAIN_DIR},dst=${MAIN_DIR}" \
|
||
|
--workdir "${MAIN_DIR}" \
|
||
|
"${IMAGE}" "${@}"
|