Skip to content

Commit

Permalink
add makefile and go mod
Browse files Browse the repository at this point in the history
Signed-off-by: zhangyongxi <[email protected]>
  • Loading branch information
wuyingjun-lucky committed Aug 15, 2023
1 parent 2b5ed75 commit 5670e92
Show file tree
Hide file tree
Showing 5 changed files with 517 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile.clusterrouter
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM centos:centos7
LABEL description="/clusterrouter"

COPY ./bin/clusterrouter clusterrouter
ENTRYPOINT ["/clusterrouter"]
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
REGISTRY_NAME=xxxx
GIT_COMMIT=$(shell git rev-parse "HEAD^{commit}")
VERSION=$(shell git describe --tags --abbrev=14 "${GIT_COMMIT}^{commit}" --always)
BUILD_TIME=$(shell TZ=Asia/Shanghai date +%FT%T%z)

CMDS=build-clusterrouter
all: build

build: clusterrouter

clusterrouter:
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -ldflags "-X 'main.buildVersion=$(VERSION)' -X 'main.buildTime=${BUILD_TIME}'" -o ./bin/clusterrouter ./cmd/virtualnode-manager

container: container-clusterrouter

container-clusterrouter: clusterrouter
docker build -t $(REGISTRY_NAME)/clusterrouter:$(VERSION) -f Dockerfile.clusterrouter --label revision=$(REV) .
Empty file added README.md
Empty file.
74 changes: 74 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
module github.com/clusterrouter-io/clusterrouter

go 1.19

require (
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/google/go-cmp v0.5.9
github.com/mattbaird/jsonpatch v0.0.0-20230413205102-771768614e91
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.6.0
go.opencensus.io v0.24.0
golang.org/x/sync v0.1.0
golang.org/x/time v0.3.0
k8s.io/api v0.27.2
k8s.io/apimachinery v0.27.2
k8s.io/apiserver v0.25.2
k8s.io/client-go v0.27.2
k8s.io/component-base v0.27.2
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.90.1
k8s.io/metrics v0.18.4
k8s.io/utils v0.0.0-20230209194617-a36077c30491
sigs.k8s.io/controller-runtime v0.15.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 5670e92

Please sign in to comment.