mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-12 11:36:29 +00:00
56a854fe14
* update github.com/docker/cli * update github.com/docker/distribution * update github.com/docker/docker * update github.com/gin-gonic/gin * update github.com/golang-jwt/jwt/v4 * update github.com/golangci/golangci-lint * update github.com/gorilla/securecookie * update github.com/mattn/go-sqlite3 * update github.com/moby/moby * update github.com/prometheus/client_golang * update github.com/xanzy/go-gitlab
32 lines
835 B
Makefile
32 lines
835 B
Makefile
GIT_TAG?= $(shell git describe --abbrev=0)
|
|
|
|
GO_VERSION = 1.16
|
|
BUILDFLAGS := '-w -s'
|
|
|
|
IMAGE_REPO = "tommymuehle"
|
|
BIN = "go-mnd"
|
|
|
|
clean:
|
|
rm -rf build dist coverage.txt
|
|
|
|
test:
|
|
go test -race ./...
|
|
|
|
test-coverage:
|
|
go test -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./checks,./config
|
|
|
|
build:
|
|
go build -o build/$(BIN) cmd/mnd/main.go
|
|
|
|
image:
|
|
@echo "Building the Docker image..."
|
|
docker build --rm -t $(IMAGE_REPO)/$(BIN):$(GIT_TAG) --build-arg GO_VERSION=$(GO_VERSION) .
|
|
docker tag $(IMAGE_REPO)/$(BIN):$(GIT_TAG) $(IMAGE_REPO)/$(BIN):$(GIT_TAG)
|
|
docker tag $(IMAGE_REPO)/$(BIN):$(GIT_TAG) $(IMAGE_REPO)/$(BIN):latest
|
|
|
|
image-push: image
|
|
@echo "Pushing the Docker image..."
|
|
docker push $(IMAGE_REPO)/$(BIN):$(GIT_TAG)
|
|
docker push $(IMAGE_REPO)/$(BIN):latest
|
|
|
|
.PHONY: clean test test-coverage build image image-push
|