forked from onosproject/onos-lib-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (37 loc) · 1.9 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
export CGO_ENABLED=1
export GO111MODULE=on
.PHONY: build
ONOS_PROTOC_VERSION := v0.6.9
build: # @HELP build the Go binaries (default)
build:
go build github.com/onosproject/onos-lib-go/pkg/...
build-tools:=$(shell if [ ! -d "./build/build-tools" ]; then cd build && git clone https://github.com/onosproject/build-tools.git; fi)
include ./build/build-tools/make/onf-common.mk
mod-update: # @HELP Download the dependencies to the vendor folder
go mod tidy
go mod vendor
mod-lint: mod-update # @HELP ensure that the required dependencies are in place
# dependencies are vendored, but not committed, go.sum is the only thing we need to check
bash -c "diff -u <(echo -n) <(git diff go.sum)"
test: # @HELP run the unit tests and source code validation producing a golang style report
test: mod-lint build linters license
go test -race github.com/onosproject/onos-lib-go/pkg/...
jenkins-test: # @HELP run the unit tests and source code validation producing a junit style report for Jenkins
jenkins-test: mod-lint build linters license
TEST_PACKAGES=github.com/onosproject/onos-lib-go/pkg/... ./build/build-tools/build/jenkins/make-unit
protos: # @HELP compile the protobuf files (using protoc-go Docker)
docker run -it -v `pwd`:/go/src/github.com/onosproject/onos-lib-go \
-w /go/src/github.com/onosproject/onos-lib-go \
--entrypoint build/bin/compile-protos.sh \
onosproject/protoc-go:${ONOS_PROTOC_VERSION}
publish: # @HELP publish version on github and dockerhub
./build/build-tools/publish-version ${VERSION}
jenkins-publish: jenkins-tools # @HELP Jenkins calls this to publish artifacts
./build/build-tools/release-merge-commit
./build/build-tools/build/docs/push-docs
all: test
clean:: # @HELP remove all the build artifacts
go clean -testcache github.com/onosproject/onos-lib-go/...