Skip to content

Commit

Permalink
fix: 升级 vine
Browse files Browse the repository at this point in the history
  • Loading branch information
Lack30 committed Feb 6, 2023
1 parent 29288a9 commit 941feca
Show file tree
Hide file tree
Showing 60 changed files with 1,076 additions and 1,235 deletions.
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
GIT_COMMIT=$(shell git rev-parse --short HEAD)
GIT_TAG=$(shell git describe --abbrev=0 --tags --always --match "v*")
GIT_VERSION=github.com/vine-io/gpm/pkg/runtime/doc
GIT_VERSION=github.com/vine-io/gpm/pkg/internal/doc
CGO_ENABLED=0
BUILD_DATE=$(shell date +%s)
GPM_DIR=$(shell pwd)/pkg/ctl/testdata
LDFLAGS=-X $(GIT_VERSION).GitCommit=$(GIT_COMMIT) -X $(GIT_VERSION).GitTag=$(GIT_TAG) -X $(GIT_VERSION).BuildDate=$(BUILD_DATE)

release:
Expand Down Expand Up @@ -34,34 +35,34 @@ vendor:
go mod vendor

build-darwin-amd64:
mkdir -p cmd/gpm/pkg/testdata
mkdir -p $(GPM_DIR)
mkdir -p _output/darwin
GOOS=darwin GOARCH=amd64 go build -o cmd/gpm/pkg/testdata/gpmd -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
GOOS=darwin GOARCH=amd64 go build -o $(GPM_DIR)/gpmd -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
GOOS=darwin GOARCH=amd64 go build -o _output/darwin/gpm -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpm/main.go

build-darwin-arm64:
mkdir -p cmd/gpm/pkg/testdata
mkdir -p $(GPM_DIR)
mkdir -p _output/darwin
GOOS=darwin GOARCH=arm64 go build -o cmd/gpm/pkg/testdata/gpmd -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
GOOS=darwin GOARCH=arm64 go build -o $(GPM_DIR)/gpmd -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
GOOS=darwin GOARCH=arm64 go build -o _output/darwin/gpm -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpm/main.go

build-windows:
mkdir -p cmd/gpm/pkg/testdata
mkdir -p $(GPM_DIR)
mkdir -p _output/windows
cp nssm.exe cmd/gpm/pkg/testdata/nssm.exe
GOOS=windows GOARCH=amd64 go build -o cmd/gpm/pkg/testdata/gpmd.exe -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
cp nssm.exe $(GPM_DIR)/nssm.exe
GOOS=windows GOARCH=amd64 go build -o $(GPM_DIR)/gpmd.exe -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
GOOS=windows GOARCH=amd64 go build -o _output/windows/gpm.exe -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpm/main.go

build-linux-amd64:
mkdir -p cmd/gpm/pkg/testdata
mkdir -p $(GPM_DIR)
mkdir -p _output/linux
GOOS=linux GOARCH=amd64 go build -o cmd/gpm/pkg/testdata/gpmd -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
GOOS=linux GOARCH=amd64 go build -o $(GPM_DIR)/gpmd -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
GOOS=linux GOARCH=amd64 go build -o _output/linux/gpm -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpm/main.go

build-linux-arm64:
mkdir -p cmd/gpm/pkg/testdata
mkdir -p $(GPM_DIR)
mkdir -p _output/linux
GOOS=linux GOARCH=arm64 go build -o cmd/gpm/pkg/testdata/gpmd -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
GOOS=linux GOARCH=arm64 go build -o $(GPM_DIR)/gpmd -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpmd/main.go
GOOS=linux GOARCH=arm64 go build -o _output/linux/gpm -a -installsuffix cgo -ldflags "-s -w ${LDFLAGS}" cmd/gpm/main.go

build-amd: build-darwin-amd64 build-linux-amd64 build-windows
Expand Down
10 changes: 10 additions & 0 deletions api/service/gpm/v1/gpm.pb.vine.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 30 additions & 31 deletions cmd/gpm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,47 +29,46 @@ import (
"time"

"github.com/vine-io/cli"
"github.com/vine-io/gpm/cmd/gpm/pkg"
"github.com/vine-io/gpm/pkg/runtime"
"github.com/vine-io/gpm/pkg/ctl"
verrs "github.com/vine-io/vine/lib/errors"
)

func main() {
app := &cli.App{
Name: "gpm",
Usage: "package manage tools",
Version: runtime.GetVersion(),
Version: ctl.GetVersion(),
Commands: []*cli.Command{
pkg.HealthCmd(),
pkg.DeployCmd(),
pkg.TarCmd(),
pkg.UnTarCmd(),
pkg.UpdateCmd(),
pkg.RunCmd(),
pkg.ShutdownCmd(),
ctl.HealthCmd(),
ctl.DeployCmd(),
ctl.TarCmd(),
ctl.UnTarCmd(),
ctl.UpdateCmd(),
ctl.RunCmd(),
ctl.ShutdownCmd(),

pkg.ListServicesCmd(),
pkg.InfoServiceCmd(),
pkg.GetServiceCmd(),
pkg.CreateServiceCmd(),
pkg.EditServiceCmd(),
pkg.StartServiceCmd(),
pkg.StopServiceCmd(),
pkg.DeleteServiceCmd(),
pkg.RestartServiceCmd(),
pkg.TailServiceCmd(),
ctl.ListServicesCmd(),
ctl.InfoServiceCmd(),
ctl.GetServiceCmd(),
ctl.CreateServiceCmd(),
ctl.EditServiceCmd(),
ctl.StartServiceCmd(),
ctl.StopServiceCmd(),
ctl.DeleteServiceCmd(),
ctl.RestartServiceCmd(),
ctl.TailServiceCmd(),

pkg.InstallServiceCmd(),
pkg.UpgradeServiceCmd(),
pkg.RollbackServiceCmd(),
pkg.ForgetServiceCmd(),
pkg.VersionServiceCmd(),
ctl.InstallServiceCmd(),
ctl.UpgradeServiceCmd(),
ctl.RollbackServiceCmd(),
ctl.ForgetServiceCmd(),
ctl.VersionServiceCmd(),

pkg.LsBashCmd(),
pkg.ExecBashCmd(),
pkg.PushBashCmd(),
pkg.PullBashCmd(),
pkg.TerminalBashCmd(),
ctl.LsBashCmd(),
ctl.ExecBashCmd(),
ctl.PushBashCmd(),
ctl.PullBashCmd(),
ctl.TerminalBashCmd(),
},
Flags: []cli.Flag{
&cli.StringFlag{
Expand Down Expand Up @@ -105,7 +104,7 @@ func main() {
sort.Sort(cli.FlagsByName(app.Flags))
sort.Sort(cli.CommandsByName(app.Commands))

app.Version = runtime.GitTag
app.Version = ctl.GetGitTag()
err := app.Run(os.Args)
if err != nil {
fmt.Fprintf(os.Stdout, "gpm exec: %s\n", verrs.FromErr(err).Detail)
Expand Down
79 changes: 67 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,31 +1,86 @@
module github.com/vine-io/gpm

go 1.16
go 1.18

require (
github.com/StackExchange/wmi v1.2.0 // indirect
github.com/gin-gonic/gin v1.7.7
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/gin-gonic/gin v1.8.2
github.com/gogo/protobuf v1.3.2
github.com/google/uuid v1.2.0
github.com/hpcloud/tail v1.0.0
github.com/json-iterator/go v1.1.12
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/olekukonko/tablewriter v0.0.5
github.com/prometheus/client_golang v1.11.0
github.com/schollz/progressbar/v3 v3.8.2
github.com/shirou/gopsutil v3.21.6+incompatible
github.com/tklauser/go-sysconf v0.3.7 // indirect
github.com/vine-io/cli v1.3.0
github.com/vine-io/pkg/inject v0.1.0
github.com/vine-io/pkg/release v0.1.0
github.com/vine-io/pkg/unit v0.1.0
github.com/vine-io/plugins/logger/zap v1.4.4
github.com/vine-io/vine v1.4.11
golang.org/x/text v0.3.7
golang.org/x/tools v0.1.12 // indirect
github.com/vine-io/vine v1.4.17
golang.org/x/text v0.6.0
google.golang.org/grpc v1.47.0
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/StackExchange/wmi v1.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/evanphx/json-patch/v5 v5.2.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.11.1 // indirect
github.com/goccy/go-json v0.9.11 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.1 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/rakyll/statik v0.1.7 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/tklauser/go-sysconf v0.3.7 // indirect
github.com/tklauser/numcpus v0.2.3 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
github.com/vine-io/gscheduler v0.3.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/term v0.4.0 // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 941feca

Please sign in to comment.