Skip to content

Commit

Permalink
simplify docker
Browse files Browse the repository at this point in the history
  • Loading branch information
kiorky committed Dec 15, 2020
1 parent 7402fe7 commit 2a7b48e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion bin/control.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -e

export SC=$(readlink -f "$0")
export DSC=$(dirname "$SC")
. "$DSC/common" || exit 1
Expand Down Expand Up @@ -78,7 +79,7 @@ main() {
shift
( call_gulp serve $@; )
;;
"hugo "*)
"hugo"*)
( vactivate && $@ ;)
;;
*)
Expand Down
15 changes: 7 additions & 8 deletions bin/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" \
Expand Down

0 comments on commit 2a7b48e

Please sign in to comment.