mirror of
https://git.busybox.net/buildroot.git
synced 2024-11-27 15:33:28 +08:00
cc9470c2d8
Since this is a helper script there is not much reason to show the command that's been issued. Furthermore, the incantation has been slightly extended since the script was introduced. The only interesting reason to print the command is to know what image it is being spawned into. However, this is prominently displayed by docker the first time the script is run, as it can't find the image locally and has to fetch it first. Afterwards, users can still use 'docker image ls' to see what images they have locally. So let's remove 'set -x' before running docker. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com> [yann.morin.1998@free.fr: reword and expand commit log] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
14 lines
437 B
Bash
Executable File
14 lines
437 B
Bash
Executable File
#!/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}" "${@}"
|