entrypoint: Update Makefile
Added GoDeps
Added schema generator.
Fix CI by using ../tools/bin in the path
@@ -2,9 +2,9 @@ my_dir := $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST))))
version = $(shell date +%Y-%m-%d).$(shell git rev-parse --short HEAD)~$(shell test -n "`git status -s`" && echo dirty || echo clean)
cosa_dir = $(shell test -d /usr/lib/coreos-assembler && echo /usr/lib/coreos-assembler)
ldflags=-X main.version=${version} -X main.cosaDir=${cosa_dir}
-test_tags := $(shell which minio 2> /dev/null &>1 && echo "ci,integration" || echo "ci")
-export PATH := $(my_dir)/bin:$(PATH)
+export PATH := $(my_dir)/bin:$(shell readlink -f ../tools/bin):$(PATH)
+
PREFIX ?= /usr
DESTDIR ?=
ARCH:=$(shell uname -m)
@@ -17,21 +17,38 @@ build: test
.PHONY: fmt
fmt:
gofmt -d -e -l $(shell find . -iname "*.go" -not -path "./vendor/*")
+ golangci-lint run -v ./...
.PHONY: test
test: fmt
- go test -mod=vendor -tags ${test_tags} -i ${pkgs} && \
- go test -mod=vendor -tags ${test_tags} -cover ${pkgs}
+ go test -mod=vendor -tags ${test_tags} -v -i ${pkgs} && \
+ go test -mod=vendor -tags ${test_tags} -v -cover ${pkgs}
.PHONY: clean
clean:
@go clean .
@rm -rf bin
+.PHYON: schema
+schema: schema_version = v1
+schema:
+ schematyper \
+ ../src/schema/$(schema_version).json \
+ -o cosa/v1.go \
+ --package=cosa \
+ --root-type=Build \
+ --ptr-for-omit
+
.PHONY: install
install: bin/entry
install -v -D -t $(DESTDIR)$(PREFIX)/bin bin/entry
+.PHONY: go-deps
+go-deps:
+ go mod tidy
+ go mod vendor
+ go mod download
+
my_uid = $(shell id -u)
.PHONY: devtest
devtest: build
