File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed
Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 33#
44all : binary
55
6+ _: =$(shell ./scripts/warn-outside-container $(MAKECMDGOALS ) )
7+
68# remove build artifacts
79.PHONY : clean
810clean :
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -eu
3+
4+ target=" ${1:- } "
5+
6+ if [[ -z " ${DISABLE_WARN_OUTSIDE_CONTAINER:- } " ]]; then
7+ (
8+ echo
9+ echo
10+ echo " WARNING: you are not in a container. Use \" ./tasks $target \" or set"
11+ echo " DISABLE_WARN_OUTSIDE_CONTAINER=1 to disable this warning."
12+ echo
13+ echo
14+ ) >&2
15+ fi
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2-
2+ #
3+ # Run a development task
4+ #
35set -eu -o pipefail
46
57unique_id=${TASK_UNIQUE_ID:- $USER }
@@ -36,7 +38,11 @@ function docker_build_and_run {
3638 local dockerfile_source=
3739 local cidfile=
3840 local remove=" --rm"
39- local envvars=" -e VERSION -e GITCOMMIT -e BUILDTIME -e LDFLAGS"
41+ local envvars=" -e VERSION \
42+ -e GITCOMMIT \
43+ -e BUILDTIME \
44+ -e LDFLAGS \
45+ -e DISABLE_WARN_OUTSIDE_CONTAINER=1"
4046 # Use an array to preserve whitespace in $PWD
4147 local mounts=(-v " $PWD :/go/src/github.com/docker/cli" )
4248 if [ -t 1 ] ; then local use_tty=" -ti" ; else local use_tty=" " ; fi
@@ -53,7 +59,14 @@ function docker_build_and_run {
5359 fi
5460
5561 echo " $dockerfile_source " | docker build -t " $image " -f " $dockerfile " .
56- docker run $remove $envvars $cidfile $use_tty ${mounts[@]+" ${mounts[@]} " } " $image " $cmd
62+ docker run \
63+ $remove \
64+ $envvars \
65+ $cidfile \
66+ $use_tty \
67+ ${mounts[@]+" ${mounts[@]} " } \
68+ " $image " \
69+ $cmd
5770}
5871
5972function usage {
You can’t perform that action at this time.
0 commit comments