2018-08-04 02:22:54 +00:00
|
|
|
DOCKER_TAG ?= dockron-dev
|
2018-08-03 18:35:49 +00:00
|
|
|
|
2018-08-03 01:11:07 +00:00
|
|
|
.PHONY: default
|
|
|
|
default: build
|
|
|
|
|
|
|
|
# Downloads dependencies into vendor directory
|
|
|
|
vendor:
|
|
|
|
dep ensure
|
|
|
|
|
|
|
|
# Runs the application, useful while developing
|
|
|
|
.PHONY: run
|
|
|
|
run: vendor
|
|
|
|
go run *.go
|
|
|
|
|
|
|
|
# Output target
|
2018-08-04 02:22:54 +00:00
|
|
|
dockron: vendor
|
|
|
|
go build -o dockron
|
2018-08-03 01:11:07 +00:00
|
|
|
|
|
|
|
# Alias for building
|
|
|
|
.PHONY: build
|
2018-08-04 02:22:54 +00:00
|
|
|
build: dockron
|
2018-08-03 01:11:07 +00:00
|
|
|
|
|
|
|
# Cleans all build artifacts
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2018-08-04 02:22:54 +00:00
|
|
|
rm dockron
|
2018-08-03 01:11:07 +00:00
|
|
|
|
|
|
|
# Cleans vendor directory
|
|
|
|
.PHONY: clean-vendor
|
|
|
|
clean-vendor:
|
|
|
|
rm -fr ./vendor
|
|
|
|
|
|
|
|
# Attempts to update dependencies
|
|
|
|
.PHONY: dep-update
|
|
|
|
dep-update:
|
|
|
|
dep ensure -update
|
2018-08-03 18:35:49 +00:00
|
|
|
|
|
|
|
.PHONY: docker-build
|
|
|
|
docker-build:
|
|
|
|
docker build -t $(DOCKER_TAG) .
|
|
|
|
|
|
|
|
.PHONY: docker-run
|
|
|
|
docker-run:
|
|
|
|
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --name $(DOCKER_TAG)-run $(DOCKER_TAG)
|