From bb49f3d2ad9ef7486a511e089545edf68b912612 Mon Sep 17 00:00:00 2001 From: blylei Date: Sun, 26 Nov 2023 00:01:46 +0800 Subject: [PATCH] init --- .goreleaser.yaml | 20 ++++++-------------- admin/cmd/admin/admin.go | 4 ++-- agent/cmd/version.go | 4 ++-- go.mod | 2 +- scripts/buid.sh | 2 +- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index f90269d..6267349 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -30,9 +30,9 @@ builds: env: - CGO_ENABLED=0 ldflags: - - -s -w -X github.com/frabits/frabit/common/version.version={{ .Version }} - - -X github.com/frabits/frabit/common/version.commit={{ .ShortCommit }} - - -X github.com/frabits/frabit/common/version.buildDate={{ .CommitDate }} + - -s -w -X github.com/frabits/frabit/pkg/common/version.version={{ .Version }} + - -X github.com/frabits/frabit/common/pkg/version.commit={{ .ShortCommit }} + - -X github.com/frabits/frabit/common/pkg/version.buildDate={{ .CommitDate }} - id: frabit-admin main: ./admin binary: frabit-admin @@ -45,9 +45,9 @@ builds: env: - CGO_ENABLED=0 ldflags: - - -s -w -X github.com/frabits/frabit/common/version.version={{ .Version }} - - -X github.com/frabits/frabit/common/version.commit={{ .ShortCommit }} - - -X github.com/frabits/frabit/common/version.buildDate={{ .CommitDate }} + - -s -w -X github.com/frabits/frabit/pkg/common/version.version={{ .Version }} + - -X github.com/frabits/frabit/common/pkg/version.commit={{ .ShortCommit }} + - -X github.com/frabits/frabit/common/pkg/version.buildDate={{ .CommitDate }} archives: nfpms: @@ -72,14 +72,6 @@ nfpms: formats: - deb - rpm - contents: - - src: ./configs/frabit-server.yaml - dst: /etc/frabit-server/config.yml - type: 'config|noreplace' - - src: ./packages/frabit-server.service - dst: /etc/systemd/system/frabit-server.service - scripts: - postinstall: ./scripts/frabit-postinstall.sh bindir: /usr/bin section: default diff --git a/admin/cmd/admin/admin.go b/admin/cmd/admin/admin.go index ae00844..3d1668c 100644 --- a/admin/cmd/admin/admin.go +++ b/admin/cmd/admin/admin.go @@ -29,7 +29,7 @@ var CmdAdmin = &cobra.Command{ }, } -var resetAdminPassword = &cobra.Command{ +var ResetAdminPassword = &cobra.Command{ Use: "reset-admin-password ", Short: "Reset admin password at any time", Run: runResetAdminPassword, @@ -40,6 +40,6 @@ func runResetAdminPassword(cmd *cobra.Command, args []string) { } func init() { - CmdAdmin.AddCommand(resetAdminPassword) + CmdAdmin.AddCommand(ResetAdminPassword) CmdAdmin.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/agent/cmd/version.go b/agent/cmd/version.go index b3a6b51..d0aebcc 100644 --- a/agent/cmd/version.go +++ b/agent/cmd/version.go @@ -17,10 +17,10 @@ package cmd import ( "fmt" + "github.com/frabits/frabit/pkg/common/version" - "github.com/spf13/cobra" - _ "github.com/frabits/frabit/common" + "github.com/spf13/cobra" ) var newVersionCmd = &cobra.Command{ diff --git a/go.mod b/go.mod index edcbffa..3861358 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( go.mongodb.org/mongo-driver v1.11.4 go.uber.org/zap v1.24.0 golang.org/x/crypto v0.8.0 + golang.org/x/sync v0.1.0 google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef google.golang.org/grpc v1.52.0 google.golang.org/protobuf v1.31.0 @@ -76,7 +77,6 @@ require ( go.uber.org/multierr v1.9.0 // indirect golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.10.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/scripts/buid.sh b/scripts/buid.sh index 8e3f910..d07e118 100644 --- a/scripts/buid.sh +++ b/scripts/buid.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -install -m=755 /usr/local/bin/ +# install -m=755 /usr/local/bin/ install_exec(){