2020-01-17 17:10:02 +01:00
|
|
|
cmd := "bash"
|
|
|
|
msg := ""
|
2020-01-25 03:56:09 +01:00
|
|
|
IMAGE_NAME := actions_hugo_dev:latest
|
|
|
|
NODE_VERSION := $(shell cat ./.nvmrc)
|
|
|
|
DOCKER_BUILD := docker build . -t $(IMAGE_NAME) --build-arg NODE_VERSION=$(NODE_VERSION)
|
2020-01-17 17:10:02 +01:00
|
|
|
DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/etc/gitconfig $(IMAGE_NAME)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
|
|
|
$(DOCKER_BUILD)
|
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
run:
|
|
|
|
$(DOCKER_RUN) $(cmd)
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
$(DOCKER_RUN) npm test
|
|
|
|
|
|
|
|
.PHONY: commit
|
|
|
|
commit:
|
|
|
|
$(DOCKER_RUN) git commit -m "$(msg)"
|