-
Notifications
You must be signed in to change notification settings - Fork 53
/
Makefile
36 lines (27 loc) · 1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
VERSION = 0.0.1
BUILD ?=$(shell git rev-parse --short HEAD)
PKG ?=github.com/commitdev/zero
BUILD_ARGS=-v -trimpath -ldflags=all="-X ${PKG}/version.AppVersion=${VERSION} -X ${PKG}/version.AppBuild=${BUILD}"
deps:
go mod download
check:
go list -f '{{.Dir}}' ./... | grep -v /tmp/ | xargs go test -v
fmt:
go fmt ./...
build-docker-local:
docker build . -t zero:v0
build-example-docker: clean-example
mkdir -p example
docker run -v "$(shell pwd)/example:/project" --user $(shell id -u):$(shell id -g) zero:v0 create "hello-world"
docker run -v "$(shell pwd)/example/hello-world:/project" --user $(shell id -u):$(shell id -g) zero:v0 generate -l go
build:
go build ${BUILD_ARGS}
# Installs the CLI int your GOPATH
install-go:
go build -o ${GOPATH}/bin/zero
# CI Commands used on CircleCI
ci-docker-build:
docker build . -t commitdev/zero:${VERSION_TAG} -t commitdev/zero:latest
ci-docker-push:
echo "${DOCKERHUB_PASS}" | docker login -u commitdev --password-stdin
docker push commitdev/zero:${VERSION_TAG}