Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ysicing committed Jul 18, 2022
2 parents 6bc73c2 + 14a4598 commit 81e4c61
Show file tree
Hide file tree
Showing 12 changed files with 279 additions and 72 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## v1.0.7 (2022-07-08)

* [b9b1a8f](https://github.com/easysoft/qucheng_cli/commit/b9b1a8f834f80cb096f92a0ee157156ec38b6302) fix(token): fix api token typo

### Contributors

* ysicing

## v1.0.6 (2022-07-08)

* [e3177ee](https://github.com/easysoft/qucheng_cli/commit/e3177ee47c782637e3f63edf7b1a3159d535e793) chore(update): update version
* [2809145](https://github.com/easysoft/qucheng_cli/commit/28091456e3a2c9fc9bfcfc57c67e24f0e44a894d) feat(update): fix install version typo
* [b9d0ac6](https://github.com/easysoft/qucheng_cli/commit/b9d0ac6b1594580817daa831efcef36e2c20fed7) feat(update): fix get app api req path typo
* [70c133c](https://github.com/easysoft/qucheng_cli/commit/70c133c7ee3c441448bbb5da5e36d5c7742391ef) feat(update): update (#34)
* [0d7af12](https://github.com/easysoft/qucheng_cli/commit/0d7af125d7418b691aef92dab1ac0f35fdb16436) docs(install): fix install docs (#30)
* [94ff7df](https://github.com/easysoft/qucheng_cli/commit/94ff7df69b287b4bb6b919ecdcbdb92599bcade0) feat(upgrade): fix upgrade tools
* [77f32ca](https://github.com/easysoft/qucheng_cli/commit/77f32ca2b999c76f12c2751e55d69ae66e42886c) fix(typo): fix upgrade cleanup old res (#33)

### Contributors

* ysicing
* 缘生

## v1.0.5-beta2 (2022-07-06)

* [7dc0adc](https://github.com/easysoft/qucheng_cli/commit/7dc0adc589c94b61ed1e3d3780044b419258ef06) feat(install): fix install chart version (#29)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ build: ## build binary
generate: ## generate
go generate ./...

dev: ## dev test
dev: generate ## dev test
GO_ENABLED=1 gox -osarch="linux/amd64" \
-output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" \
-ldflags ${LDFLAGS}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.7
1.0.8
3 changes: 2 additions & 1 deletion cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import (
func newCmdUpgrade(f factory.Factory) *cobra.Command {
up := &cobra.Command{
Use: "upgrade",
Short: "Upgrades the Q CLI to the newest version",
Short: "Upgrades the Qucheng cli or plugin to the newest version",
Aliases: []string{"ug", "ugc"},
}
up.AddCommand(upgrade.NewUpgradeQ(f))
up.AddCommand(upgrade.NewUpgradeOperator(f))
return up
}
38 changes: 38 additions & 0 deletions cmd/upgrade/operator.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) 2021-2022 北京渠成软件有限公司(Beijing Qucheng Software Co., Ltd. www.qucheng.com) All rights reserved.
// Use of this source code is covered by the following dual licenses:
// (1) Z PUBLIC LICENSE 1.2 (ZPL 1.2)
// (2) Affero General Public License 3.0 (AGPL 3.0)
// license that can be found in the LICENSE file.

package upgrade

import (
"os"

qcexec "github.com/easysoft/qcadmin/internal/pkg/util/exec"
"github.com/easysoft/qcadmin/internal/pkg/util/factory"
"github.com/spf13/cobra"
)

func NewUpgradeOperator(f factory.Factory) *cobra.Command {
up := option{
log: f.GetLog(),
}
upq := &cobra.Command{
Use: "operator",
Short: "upgrade operator to the newest version",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
up.DoOperator()
},
}
return upq
}

func (up option) DoOperator() {
qcexec.CommandRun(os.Args[0], "manage", "plugins", "sync")
if err := qcexec.CommandRun(os.Args[0], "manage", "plugins", "enable", "cne-operator"); err != nil {
up.log.Errorf("upgrade plugin cne-operator err: %v", err)
return
}
}
49 changes: 24 additions & 25 deletions common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,30 @@ const (
)

const (
DefaultQuchengVersion = "stable-1.1.0"
K3sBinName = "k3s"
K3sBinPath = "/usr/local/bin/k3s"
HelmBinName = "helm"
HelmBinPath = "/usr/local/bin/helm"
K3sBinVersion = "v1.23.5+k3s1"
K3sBinURL = "https://github.com/k3s-io/k3s/releases/download"
K3sAgentEnv = "/etc/systemd/system/k3s-agent.service.env"
K3sKubeConfig = "/etc/rancher/k3s/k3s.yaml"
KubeQPS = 5.0
KubeBurst = 10
KubectlBinPath = "/usr/local/bin/kubectl"
QcAdminBinPath = "/usr/local/bin/qcadmin"
StatusWaitDuration = 5 * time.Minute
WaitRetryInterval = 5 * time.Second
DefaultHelmRepoName = "install"
DefaultSystem = "cne-system"
DefaultChartName = "qucheng"
DefaultAPIChartName = "cne-api"
DefaultQuchengName = "qucheng"
DefaultCneAPIName = "cne-api"
DefaultDBName = "qucheng-mysql"
InitFileName = ".initdone"
InitLockFileName = ".qlock"
InitModeCluster = ".incluster"
DefaultQuchengVersion = "stable-1.1.1"
K3sBinName = "k3s"
K3sBinPath = "/usr/local/bin/k3s"
HelmBinName = "helm"
HelmBinPath = "/usr/local/bin/helm"
K3sBinVersion = "v1.23.8+k3s1"
K3sBinURL = "https://github.com/k3s-io/k3s/releases/download"
K3sAgentEnv = "/etc/systemd/system/k3s-agent.service.env"
K3sKubeConfig = "/etc/rancher/k3s/k3s.yaml"
KubeQPS = 5.0
KubeBurst = 10
KubectlBinPath = "/usr/local/bin/kubectl"
QcAdminBinPath = "/usr/local/bin/qcadmin"
StatusWaitDuration = 5 * time.Minute
WaitRetryInterval = 5 * time.Second
DefaultHelmRepoName = "install"
DefaultSystem = "cne-system"
DefaultQuchengName = "qucheng"
DefaultCneOperatorName = "cne-operator"
DefaultIngressName = "nginx-ingress-controller"
DefaultDBName = "qucheng-mysql"
InitFileName = ".initdone"
InitLockFileName = ".qlock"
InitModeCluster = ".incluster"
)

const (
Expand Down
25 changes: 18 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ go 1.18
require (
github.com/BeidouCloudPlatform/go-bindata/v4 v4.1.0
github.com/Masterminds/semver/v3 v3.1.1
github.com/cheggaaa/pb/v3 v3.0.8
github.com/cheggaaa/pb/v3 v3.1.0
github.com/containerd/continuity v0.3.0
github.com/docker/docker v20.10.17+incompatible
github.com/ergoapi/util v0.2.19
github.com/gofrs/flock v0.8.1
github.com/gosuri/uitable v0.0.4
github.com/imroc/req/v3 v3.13.2
github.com/imroc/req/v3 v3.14.0
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213
github.com/kardianos/service v1.2.1-0.20211104163826-b9d1d5b7279b
Expand All @@ -28,7 +28,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/ulikunitz/xz v0.5.10
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v2 v2.4.0
gotest.tools v2.2.0+incompatible
Expand Down Expand Up @@ -63,6 +63,7 @@ require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect
github.com/cheekybits/genny v1.0.0 // indirect
github.com/containerd/containerd v1.6.6 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
Expand All @@ -78,13 +79,15 @@ require (
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/camelcase v1.0.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/fvbommel/sortorder v1.0.1 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-gorp/gorp/v3 v3.0.2 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
Expand Down Expand Up @@ -112,7 +115,13 @@ require (
github.com/lib/pq v1.10.4 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/lithammer/dedent v1.1.0 // indirect
github.com/lucas-clemente/quic-go v0.28.0 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/marten-seemann/qpack v0.2.1 // indirect
github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
github.com/marten-seemann/qtls-go1-17 v0.1.2 // indirect
github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect
github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-runewidth v0.0.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
Expand All @@ -129,6 +138,8 @@ require (
github.com/muesli/mango v0.1.0 // indirect
github.com/muesli/mango-pflag v0.1.0 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
github.com/otiai10/copy v1.7.0 // indirect
Expand All @@ -152,19 +163,19 @@ require (
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220630215102-69896b714898 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/tools v0.1.11 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 // indirect
google.golang.org/grpc v1.43.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiextensions-apiserver v0.24.0 // indirect
k8s.io/apiserver v0.24.0 // indirect
Expand Down
Loading

0 comments on commit 81e4c61

Please sign in to comment.