#!/bin/sh

image=${WF_DOCKER_IMAGE:-gcr.io/web-central/wf-dev}
cmd=$1
action=$2
if [[ "$cmd" = "grunt" && "$action" = "develop" ]]; then
	action="develop-no-open"
fi
# remove $cmd and $action from $@
shift
shift

args="-v $(pwd)/src:/wf/src -v $(pwd)/appengine/build:/wf/appengine/build"
if [[ "$action" = develop* ]]; then
	args="$args -p 8081:8081 -p 35729:35729"
fi

docker run -ti --rm $args $image $cmd $action "$@"

# revert ownership of files generated by root within the container
if [ "$cmd" = "grunt" ]; then
	owner=$(id -ru):$(id -rg)
	docker run --rm $args $image chown -R $owner /wf/appengine/build /wf/src/icons
fi


#!/bin/sh

image=${WF_DOCKER_IMAGE:-google/webfundamentals}
cmd=$1
action=$2
if [[ "$cmd" = "grunt" && "$action" = "develop" ]]; then
	action="develop-no-open"
fi
# remove $cmd and $action from $@
shift
shift

args="-v $(pwd)/src:/wf/src -v $(pwd)/appengine/build:/wf/appengine/build"
if [[ "$action" = develop* ]]; then
	args="$args -p 8081:8081 -p 35729:35729"
fi

docker run -ti --rm $args $image $cmd $action "$@"

# revert ownership of files generated by root within the container
if [ "$cmd" = "grunt" ]; then
	owner=$(id -ru):$(id -rg)
	docker run --rm $args $image chown -R $owner /wf/appengine/build /wf/src/icons
fi


Switch to auto-build image google/webfundamentals
Switch to auto-build image google/webfundamentals

https://registry.hub.docker.com/u/google/webfundamentals/
