12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ # make builder configurable, default to docker.
16
+ ENGINE ?= docker
17
+
15
18
# collect args from `make run` so that they don't run twice
16
19
ifeq (run,$(firstword $(MAKECMDGOALS ) ) )
17
20
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS ) ) ,$(MAKECMDGOALS ) )
18
21
ifneq ("$(wildcard /.dockerenv)","")
19
- $(error Inside docker container, run 'make $(RUN_ARGS)')
22
+ $(error Inside the developer container, run 'make $(RUN_ARGS)')
20
23
endif
21
24
endif
22
25
@@ -25,29 +28,29 @@ endif
25
28
all : build
26
29
27
30
.PHONY : build
28
- # # Build runtime Docker image
31
+ # # Build runtime container image
29
32
build :
30
- ./scripts/build_docker.sh --target runtime
33
+ ENGINE= ${ENGINE} && ./scripts/build_docker.sh --target runtime
31
34
32
35
.PHONY : build.develop
33
36
# # Build developer container image
34
37
build.develop :
35
- ./scripts/build_docker.sh --target develop
38
+ ENGINE= ${ENGINE} && ./scripts/build_docker.sh --target develop
36
39
37
40
.PHONY : use.develop
38
- # # Check if developer image exists, build it if it doesn't
41
+ # # Check if developer container image exists, build it if it doesn't
39
42
use.develop :
40
- ./scripts/build_docker.sh --target develop --use-existing
43
+ ENGINE= ${ENGINE} && ./scripts/build_docker.sh --target develop --use-existing
41
44
42
45
.PHONY : develop
43
- # # Run interactive shell inside developer container
46
+ # # Run interactive shell inside developer container image
44
47
develop : use.develop
45
- ./scripts/develop.sh
48
+ ENGINE= ${ENGINE} && ./scripts/develop.sh
46
49
47
50
.PHONY : run
48
51
# # Run make target inside developer container (e.g. `make run fmt`)
49
52
run : use.develop
50
- ./scripts/develop.sh make $(RUN_ARGS )
53
+ ENGINE= ${ENGINE} && ./scripts/develop.sh make $(RUN_ARGS )
51
54
52
55
.PHONY : test
53
56
# # Run tests
0 commit comments