1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-14 02:57:18 +00:00

Use locals where possible

This commit is contained in:
Kristóf Tóth 2018-06-15 15:47:06 +02:00
parent 35776e7d7f
commit 6248da24e7

View File

@ -14,13 +14,13 @@ source "${libhack_dir}/common.sh"
challenge::build() {
pushd "${CHALLENGE_PATH}"
ARGS="--build-arg NOFRONTEND=1" build_challenge_internal
args="--build-arg NOFRONTEND=1" build_challenge_internal
popd
}
challenge::build_with_frontend() {
pushd "${CHALLENGE_PATH}"
ARGS="--no-cache" build_challenge_internal
args="--no-cache" build_challenge_internal
popd
}
@ -28,11 +28,14 @@ build_challenge_internal() {
docker build -t "${IMAGE_NAME}" \
-f "${BUILD_CONTEXT}/Dockerfile" \
--build-arg BUILD_CONTEXT="${BUILD_CONTEXT}" \
${ARGS} .
${args} .
}
challenge::run() {
pushd "${TFW_PATH}"
local mount_baseimage
local mount_challenge
local mount_volumes
if [ "${HOTRELOAD:-0}" == "1" ]; then
[ -d "${BASEIMAGE_PATH}" ] && mount_baseimage="-v ${BASEIMAGE_PATH}/lib/tfw:/usr/local/lib/tfw"
mount_challenge="-v ${CHALLENGE_PATH}/solvable/src:/srv/.tfw"