Merge branch 'qiniu-v2'
This commit is contained in:
commit
49c91795c6
4
.github/e2e-linux.yml
vendored
4
.github/e2e-linux.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.16.x
|
go-version: 1.22.x
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Go build
|
- name: Go build
|
||||||
@ -33,5 +33,5 @@ jobs:
|
|||||||
./goc build -o ./gocc .
|
./goc build -o ./gocc .
|
||||||
- name: run e2e test
|
- name: run e2e test
|
||||||
run: |
|
run: |
|
||||||
go get github.com/onsi/ginkgo/ginkgo
|
go install github.com/onsi/ginkgo/ginkgo
|
||||||
make e2e
|
make e2e
|
4
.github/e2e-wins.yml
vendored
4
.github/e2e-wins.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.16.x
|
go-version: 1.22.x
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Go build
|
- name: Go build
|
||||||
@ -33,5 +33,5 @@ jobs:
|
|||||||
.\goc.exe build -o gocc .
|
.\goc.exe build -o gocc .
|
||||||
- name: run e2e test
|
- name: run e2e test
|
||||||
run: |
|
run: |
|
||||||
go get github.com/onsi/ginkgo/ginkgo
|
go install github.com/onsi/ginkgo/ginkgo
|
||||||
ginkgo tests/e2e/...
|
ginkgo tests/e2e/...
|
2
.github/style_check.yml
vendored
2
.github/style_check.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
name: vet and gofmt
|
name: vet and gofmt
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [1.16.x]
|
go-version: [1.22.x]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
|
2
.github/ut-check-win.yml
vendored
2
.github/ut-check-win.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
name: go test on windows
|
name: go test on windows
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [1.16.x]
|
go-version: [1.22.x]
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
|
2
.github/ut-check.yml
vendored
2
.github/ut-check.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
name: go test on linux
|
name: go test on linux
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [1.16.x]
|
go-version: [1.22.x]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
|
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
@ -57,19 +57,19 @@ jobs:
|
|||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: darwin
|
GOOS: darwin
|
||||||
|
|
||||||
# release-windows-amd64:
|
release-windows-amd64:
|
||||||
# name: release windows/amd64
|
name: release windows/amd64
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# steps:
|
steps:
|
||||||
# - uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
# - name: Install Go
|
- name: Install Go
|
||||||
# uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
# with:
|
with:
|
||||||
# go-version: 1.19.x
|
go-version: 1.22.x
|
||||||
# - name: compile and release
|
- name: compile and release
|
||||||
# run: |
|
run: |
|
||||||
# ./hack/release.sh
|
./hack/release.sh
|
||||||
# env:
|
env:
|
||||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# GOARCH: amd64
|
GOARCH: amd64
|
||||||
# GOOS: windows
|
GOOS: windows
|
@ -26,13 +26,15 @@ var buildCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
gocmode string
|
gocmode string
|
||||||
gochost string
|
gochost string
|
||||||
|
gocextra string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
buildCmd.Flags().StringVarP(&gocmode, "gocmode", "", "count", "coverage mode: set, count, atomic, watch")
|
buildCmd.Flags().StringVarP(&gocmode, "gocmode", "", "count", "coverage mode: set, count, atomic, watch")
|
||||||
buildCmd.Flags().StringVarP(&gochost, "gochost", "", "127.0.0.1:7777", "specify the host of the goc sever")
|
buildCmd.Flags().StringVarP(&gochost, "gochost", "", "127.0.0.1:7777", "specify the host of the goc sever")
|
||||||
|
buildCmd.Flags().StringVarP(&gocextra, "gocextra", "", "", "specify the extra information injected into the build")
|
||||||
rootCmd.AddCommand(buildCmd)
|
rootCmd.AddCommand(buildCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +49,7 @@ func buildAction(cmd *cobra.Command, args []string) {
|
|||||||
build.WithArgs(args),
|
build.WithArgs(args),
|
||||||
build.WithBuild(),
|
build.WithBuild(),
|
||||||
build.WithDebug(globalDebug),
|
build.WithDebug(globalDebug),
|
||||||
|
build.WithExtra(gocextra),
|
||||||
)
|
)
|
||||||
b.Build()
|
b.Build()
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ var installCmd = &cobra.Command{
|
|||||||
func init() {
|
func init() {
|
||||||
installCmd.Flags().StringVarP(&gocmode, "gocmode", "", "count", "coverage mode: set, count, atomic, watch")
|
installCmd.Flags().StringVarP(&gocmode, "gocmode", "", "count", "coverage mode: set, count, atomic, watch")
|
||||||
installCmd.Flags().StringVarP(&gochost, "gochost", "", "127.0.0.1:7777", "specify the host of the goc sever")
|
installCmd.Flags().StringVarP(&gochost, "gochost", "", "127.0.0.1:7777", "specify the host of the goc sever")
|
||||||
|
installCmd.Flags().StringVarP(&gocextra, "gocextra", "", "", "specify the extra information injected into the build")
|
||||||
rootCmd.AddCommand(installCmd)
|
rootCmd.AddCommand(installCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,6 +43,7 @@ func installAction(cmd *cobra.Command, args []string) {
|
|||||||
build.WithArgs(args),
|
build.WithArgs(args),
|
||||||
build.WithInstall(),
|
build.WithInstall(),
|
||||||
build.WithDebug(globalDebug),
|
build.WithDebug(globalDebug),
|
||||||
|
build.WithExtra(gocextra),
|
||||||
)
|
)
|
||||||
b.Install()
|
b.Install()
|
||||||
|
|
||||||
|
@ -45,9 +45,9 @@ var (
|
|||||||
token string
|
token string
|
||||||
id string
|
id string
|
||||||
cond = sync.NewCond(&sync.Mutex{})
|
cond = sync.NewCond(&sync.Mutex{})
|
||||||
register_extra = ""
|
|
||||||
commitID string = "{{.CommitID}}"
|
commitID string = "{{.CommitID}}"
|
||||||
branch string = "{{.Branch}}"
|
branch string = "{{.Branch}}"
|
||||||
|
register_extra = "{{.Extra}}"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -57,6 +57,11 @@ func init() {
|
|||||||
host = host_env
|
host = host_env
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// init extra information
|
||||||
|
if os.Getenv("GOC_REGISTER_EXTRA") != "" {
|
||||||
|
register_extra = os.Getenv("GOC_REGISTER_EXTRA")
|
||||||
|
}
|
||||||
|
|
||||||
var dialer = websocket.DefaultDialer
|
var dialer = websocket.DefaultDialer
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -31,6 +31,7 @@ type Build struct {
|
|||||||
Debug bool
|
Debug bool
|
||||||
Host string
|
Host string
|
||||||
Mode string // cover mode
|
Mode string // cover mode
|
||||||
|
Extra string
|
||||||
|
|
||||||
GOPATH string
|
GOPATH string
|
||||||
GOBIN string
|
GOBIN string
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
package build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -60,3 +62,9 @@ func WithDebug(enable bool) gocOption {
|
|||||||
b.Debug = enable
|
b.Debug = enable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WithExtra(extra string) gocOption {
|
||||||
|
return func(b *Build) {
|
||||||
|
b.Extra = strings.TrimSpace(extra)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -216,6 +216,7 @@ func (b *Build) injectGocAgent(where string, covers []*PackageCover) {
|
|||||||
Mode string
|
Mode string
|
||||||
CommitID string
|
CommitID string
|
||||||
Branch string
|
Branch string
|
||||||
|
Extra string
|
||||||
}{
|
}{
|
||||||
Covers: covers,
|
Covers: covers,
|
||||||
GlobalCoverVarImportPath: b.GlobalCoverVarImportPath,
|
GlobalCoverVarImportPath: b.GlobalCoverVarImportPath,
|
||||||
@ -224,6 +225,7 @@ func (b *Build) injectGocAgent(where string, covers []*PackageCover) {
|
|||||||
Mode: _coverMode,
|
Mode: _coverMode,
|
||||||
Branch: branch,
|
Branch: branch,
|
||||||
CommitID: commitID,
|
CommitID: commitID,
|
||||||
|
Extra: b.Extra,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := coverMainTmpl.Execute(f2, tmplData); err != nil {
|
if err := coverMainTmpl.Execute(f2, tmplData); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user