Skip to content

Commit bd896fc

Browse files
committed
add deps and Makefile
1 parent 277e11f commit bd896fc

File tree

4 files changed

+1175
-0
lines changed

4 files changed

+1175
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bin/
2+
cscope.*
3+
vendor/

Makefile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
NS := github.com/projecteru2/yavirt
2+
BUILD := go build -race
3+
TEST := go test -count=1 -race -cover
4+
5+
LDFLAGS += -X "$(NS)/ver.Git=$(shell git rev-parse HEAD)"
6+
LDFLAGS += -X "$(NS)/ver.Compile=$(shell go version)"
7+
LDFLAGS += -X "$(NS)/ver.Date=$(shell date +'%F %T %z')"
8+
9+
PKGS := $$(go list ./... | grep -v -P '$(NS)/guestfs|vendor/')
10+
11+
.PHONY: all test build guestfs
12+
13+
default: build
14+
15+
build: build-srv build-ctl
16+
17+
build-srv:
18+
$(BUILD) -ldflags '$(LDFLAGS)' -o bin/yavirtd yavirtd.go
19+
20+
build-ctl:
21+
$(BUILD) -ldflags '$(LDFLAGS)' -o bin/yavirtctl ctl/ctl.go
22+
23+
lint: format
24+
golangci-lint run --skip-dirs-use-default --skip-dirs=guestfs
25+
26+
format: vet
27+
gofmt -s -w $$(find . -iname '*.go' | grep -v -P '\./guestfs|\./vendor/')
28+
29+
vet:
30+
go vet $(PKGS)
31+
32+
deps:
33+
GO111MODULE=on go mod download
34+
GO111MODULE=on go mod vendor
35+
36+
mock: deps
37+
mockery --dir api/image --output api/image/mocks --name PushPuller
38+
mockery --dir libvirt --output libvirt/mocks --all
39+
mockery --dir sh --output sh/mocks --name Shell
40+
mockery --dir store --output store/mocks --name Store
41+
mockery --dir util --output util/mocks --name Locker
42+
mockery --dir virt/agent --output virt/agent/mocks --all
43+
mockery --dir virt/domain --output virt/domain/mocks --name Domain
44+
mockery --dir virt/guest/manager --output virt/guest/manager/mocks --name Manageable
45+
mockery --dir virt/guest --output virt/guest/mocks --name Bot
46+
mockery --dir virt/guestfs --output virt/guestfs/mocks --name Guestfs
47+
mockery --dir virt/volume --output virt/volume/mocks --name Bot
48+
49+
clean:
50+
rm -fr bin/*
51+
52+
test:
53+
ifdef RUN
54+
$(TEST) -v -run='${RUN}' $(PKGS)
55+
else
56+
$(TEST) $(PKGS)
57+
endif

go.mod

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
module github.com/projecteru2/yavirt
2+
3+
go 1.16
4+
5+
require (
6+
github.com/BurntSushi/toml v0.3.1
7+
github.com/containernetworking/cni v0.8.1
8+
github.com/coreos/bbolt v1.3.3 // indirect
9+
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
10+
github.com/getsentry/sentry-go v0.9.0
11+
github.com/gin-gonic/gin v1.6.3
12+
github.com/google/uuid v1.2.0
13+
github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8 // indirect
14+
github.com/gorilla/websocket v1.4.2 // indirect
15+
github.com/juju/errors v0.0.0-20200330140219-3fe23663418f
16+
github.com/juju/testing v0.0.0-20201030020617-7189b3728523 // indirect
17+
github.com/kelseyhightower/envconfig v1.4.0 // indirect
18+
github.com/libvirt/libvirt-go v5.2.0+incompatible
19+
github.com/onsi/ginkgo v1.14.1 // indirect
20+
github.com/onsi/gomega v1.10.2 // indirect
21+
github.com/projectcalico/api v0.0.0-20211207142834-757e73ac95b9
22+
github.com/projectcalico/go-json v0.0.0-20161128004156-6219dc7339ba // indirect
23+
github.com/projectcalico/go-yaml v0.0.0-20161201183616-955bc3e451ef // indirect
24+
github.com/projectcalico/libcalico-go v1.7.2-0.20211201231514-3402eca9d274
25+
github.com/projecteru2/core v0.0.0-20210317082513-84f470562415
26+
github.com/projecteru2/libyavirt v0.0.0-20220112061300-ac7002c411ff
27+
github.com/prometheus/client_golang v1.7.1
28+
github.com/robfig/cron/v3 v3.0.1
29+
github.com/satori/go.uuid v1.2.0 // indirect
30+
github.com/sirupsen/logrus v1.7.0
31+
github.com/stretchr/testify v1.7.0
32+
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
33+
github.com/urfave/cli/v2 v2.3.0
34+
github.com/vishvananda/netlink v1.1.0
35+
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
36+
go.etcd.io/etcd v0.5.0-alpha.5.0.20201125193152-8a03d2e9614b
37+
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678
38+
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
39+
google.golang.org/grpc v1.40.0
40+
gopkg.in/go-playground/validator.v9 v9.29.1 // indirect
41+
k8s.io/apimachinery v0.21.0
42+
k8s.io/klog v0.3.1 // indirect
43+
)
44+
45+
replace (
46+
github.com/projectcalico/libcalico-go => github.com/projectcalico/calico v1.7.1-libcalico-go.0.20211201231514-3402eca9d274
47+
google.golang.org/grpc => google.golang.org/grpc v1.29.1
48+
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7
49+
)

0 commit comments

Comments
 (0)