diff --git a/bin/control.sh b/bin/control.sh index 6410f84..769178e 100755 --- a/bin/control.sh +++ b/bin/control.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e + export SC=$(readlink -f "$0") export DSC=$(dirname "$SC") . "$DSC/common" || exit 1 @@ -78,7 +79,7 @@ main() { shift ( call_gulp serve $@; ) ;; - "hugo "*) + "hugo"*) ( vactivate && $@ ;) ;; *) diff --git a/bin/docker.sh b/bin/docker.sh index 089b258..70af309 100755 --- a/bin/docker.sh +++ b/bin/docker.sh @@ -12,13 +12,8 @@ export TAG=${TAG:-makinacorpus/sysdoc} cd "${W}" vv () { echo "$@">&2; "${@}"; } if [[ -z $NO_BUILD ]];then - # handle pb with node_modules that is too heavy - # and still uploaded to context despite being ignored - # by dockerignore - # docker build -t makinacorpus/sysdoc . - tar -cf - .\ - --exclude={.git,var,public,themes/*/*/node_modules} \ - | docker build -f "themes/$(basename $THEME)/Dockerfile" -t ${TAG} - + export DOCKERFILE="themes/$(basename $THEME)/Dockerfile" + docker build -f $DOCKERFILE --cache-from=$TAG --build-arg BUILDKIT_INLINE_CACHE=1 -t ${TAG} . fi main() { local cmd=/s/bin/control.sh @@ -35,7 +30,11 @@ main() { dargs="" ;; esac - vv exec docker run --rm -ti \ + local dargs="" + if [[ -z "${CI_JOB_ID-}${CI-}" ]];then + dargs="$dargs -ti" + fi + vv exec docker run $dargs --rm \ $(echo $dargs) \ -v "$W/content:/s/content" \ -v "$W/data:/s/data" \