mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-14 15:57:17 +00:00
Use locals where possible
This commit is contained in:
parent
35776e7d7f
commit
6248da24e7
@ -14,13 +14,13 @@ source "${libhack_dir}/common.sh"
|
|||||||
|
|
||||||
challenge::build() {
|
challenge::build() {
|
||||||
pushd "${CHALLENGE_PATH}"
|
pushd "${CHALLENGE_PATH}"
|
||||||
ARGS="--build-arg NOFRONTEND=1" build_challenge_internal
|
args="--build-arg NOFRONTEND=1" build_challenge_internal
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
challenge::build_with_frontend() {
|
challenge::build_with_frontend() {
|
||||||
pushd "${CHALLENGE_PATH}"
|
pushd "${CHALLENGE_PATH}"
|
||||||
ARGS="--no-cache" build_challenge_internal
|
args="--no-cache" build_challenge_internal
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,11 +28,14 @@ build_challenge_internal() {
|
|||||||
docker build -t "${IMAGE_NAME}" \
|
docker build -t "${IMAGE_NAME}" \
|
||||||
-f "${BUILD_CONTEXT}/Dockerfile" \
|
-f "${BUILD_CONTEXT}/Dockerfile" \
|
||||||
--build-arg BUILD_CONTEXT="${BUILD_CONTEXT}" \
|
--build-arg BUILD_CONTEXT="${BUILD_CONTEXT}" \
|
||||||
${ARGS} .
|
${args} .
|
||||||
}
|
}
|
||||||
|
|
||||||
challenge::run() {
|
challenge::run() {
|
||||||
pushd "${TFW_PATH}"
|
pushd "${TFW_PATH}"
|
||||||
|
local mount_baseimage
|
||||||
|
local mount_challenge
|
||||||
|
local mount_volumes
|
||||||
if [ "${HOTRELOAD:-0}" == "1" ]; then
|
if [ "${HOTRELOAD:-0}" == "1" ]; then
|
||||||
[ -d "${BASEIMAGE_PATH}" ] && mount_baseimage="-v ${BASEIMAGE_PATH}/lib/tfw:/usr/local/lib/tfw"
|
[ -d "${BASEIMAGE_PATH}" ] && mount_baseimage="-v ${BASEIMAGE_PATH}/lib/tfw:/usr/local/lib/tfw"
|
||||||
mount_challenge="-v ${CHALLENGE_PATH}/solvable/src:/srv/.tfw"
|
mount_challenge="-v ${CHALLENGE_PATH}/solvable/src:/srv/.tfw"
|
||||||
|
Loading…
Reference in New Issue
Block a user