mirror of
https://github.com/stakater/Reloader.git
synced 2026-02-14 18:09:50 +00:00
Added initial implementation to detect changes
This commit is contained in:
52
Makefile
Normal file
52
Makefile
Normal file
@@ -0,0 +1,52 @@
|
||||
# note: call scripts from /scripts
|
||||
|
||||
.PHONY: default build builder-image binary-image test stop clean-images clean push apply deploy
|
||||
|
||||
BUILDER ?= reloader-builder
|
||||
BINARY ?= Reloader
|
||||
DOCKER_IMAGE ?= stakater/reloader
|
||||
# Default value "dev"
|
||||
DOCKER_TAG ?= dev
|
||||
REPOSITORY = ${DOCKER_IMAGE}:${DOCKER_TAG}
|
||||
|
||||
VERSION=$(shell cat .version)
|
||||
BUILD=
|
||||
|
||||
GOCMD = go
|
||||
GLIDECMD = glide
|
||||
GOFLAGS ?= $(GOFLAGS:)
|
||||
LDFLAGS =
|
||||
|
||||
default: build test
|
||||
|
||||
install:
|
||||
"$(GLIDECMD)" install
|
||||
|
||||
build:
|
||||
"$(GOCMD)" build ${GOFLAGS} ${LDFLAGS} -o "${BINARY}"
|
||||
|
||||
builder-image:
|
||||
@docker build --network host -t "${BUILDER}" -f build/package/Dockerfile.build .
|
||||
|
||||
binary-image: builder-image
|
||||
@docker run --network host --rm "${BUILDER}" | docker build --network host -t "${REPOSITORY}" -f Dockerfile.run -
|
||||
|
||||
test:
|
||||
"$(GOCMD)" test -v ./...
|
||||
|
||||
stop:
|
||||
@docker stop "${BINARY}"
|
||||
|
||||
clean-images: stop
|
||||
@docker rmi "${BUILDER}" "${BINARY}"
|
||||
|
||||
clean:
|
||||
"$(GOCMD)" clean -i
|
||||
|
||||
push: ## push the latest Docker image to DockerHub
|
||||
docker push $(REPOSITORY)
|
||||
|
||||
apply:
|
||||
kubectl apply -f deployments/manifests/
|
||||
|
||||
deploy: binary-image push apply
|
||||
Reference in New Issue
Block a user