From 47460ca21a4a9f01444f6046b246637fb127c4e4 Mon Sep 17 00:00:00 2001 From: Abdul Dakkak Date: Thu, 4 Apr 2019 12:46:54 -0500 Subject: [PATCH] remove self-update --- .travis.yml | 3 --- Gopkg.toml | 3 --- cmd/selfupdate.go | 68 ----------------------------------------------- glide.yaml | 49 ++++++++++++++++------------------ 4 files changed, 23 insertions(+), 100 deletions(-) delete mode 100644 cmd/selfupdate.go diff --git a/.travis.yml b/.travis.yml index a2c5385..ba1131c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ before_install: - go get github.com/ahmetb/govvv - go get github.com/mitchellh/gox - go get github.com/tcnksm/ghr -- go get github.com/sanbornm/go-selfupdate - go get github.com/laher/bump/... - go get github.com/gordonklaus/ineffassign - go get github.com/client9/misspell/cmd/misspell @@ -39,7 +38,6 @@ script: # -flags) -s -w -X main.AppSecret=${APP_SECRET} -extldflags \"-static\"" -output="${DIST}/${VERSION}/{{.OS}}-{{.Arch}}/{{.Dir}}" # . before_deploy: -- echo "go-selfupdate generating bindiffs" - mkdir -p ${DIST}/${VERSION}/binaries - mkdir -p ${DIST}/latest - tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/darwin-386 ${DIST}/${VERSION}/darwin-386/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT @@ -66,7 +64,6 @@ before_deploy: ${TRAVIS_BUILD_DIR}/VERSION || true - tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/windows-amd64 ${DIST}/${VERSION}/windows-amd64/rai.exe ${TRAVIS_BUILD_DIR}/LICENSE.TXT ${TRAVIS_BUILD_DIR}/VERSION || true -- go-selfupdate -o ${DIST}/updates ${DIST}/${VERSION}/binaries/ ${VERSION} - cp ${DIST}/${VERSION}/binaries/darwin-386 ${DIST}/latest/darwin-386.tar.gz || true - cp ${DIST}/${VERSION}/binaries/darwin-amd64 ${DIST}/latest/darwin-amd64.tar.gz || true - cp ${DIST}/${VERSION}/binaries/linux-386 ${DIST}/latest/linux-386.tar.gz || true diff --git a/Gopkg.toml b/Gopkg.toml index 042ae74..7fb55e3 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -77,9 +77,6 @@ branch = "master" name = "github.com/rai-project/utils" -[[constraint]] - branch = "master" - name = "github.com/sanbornm/go-selfupdate" [[constraint]] branch = "master" diff --git a/cmd/selfupdate.go b/cmd/selfupdate.go deleted file mode 100644 index 2af5e33..0000000 --- a/cmd/selfupdate.go +++ /dev/null @@ -1,68 +0,0 @@ -// +build ignore - -package cmd - -import ( - "fmt" - "io" - "net/http" - "os" - - homedir "github.com/mitchellh/go-homedir" - ccmd "github.com/rai-project/cmd" - "github.com/sanbornm/go-selfupdate/selfupdate" - "github.com/spf13/cobra" -) - -type HTTPRequester struct { -} - -// Fetch will return an HTTP request to the specified url and return -// the body of the result. An error will occur for a non 200 status code. -func (httpRequester *HTTPRequester) Fetch(url string) (io.ReadCloser, error) { - if isDebug || isVerbose { - fmt.Println("GET " + url) - } - - resp, err := http.Get(url) - if err != nil { - return nil, err - } - - if resp.StatusCode != 200 { - return nil, fmt.Errorf("bad http status from %s: %v", url, resp.Status) - } - - return resp.Body, nil -} - -// self-updateCmd represents the self-update command -var selfUpdateCmd = &cobra.Command{ - Use: "self-update", - Aliases: []string{"update", "selfupdate"}, - Short: "Update RAI if a new version exists", - Long: `This will allow RAI to update it's self.`, - Run: func(cmd *cobra.Command, args []string) { - updateDir, _ := homedir.Expand("~/.rai_update") - updater := &selfupdate.Updater{ - CurrentVersion: ccmd.Version.Version, - ApiURL: "http://files.rai-project.com/dist/rai/stable/", - BinURL: "http://files.rai-project.com/dist/rai/stable/", - CmdName: "updates", - Dir: updateDir, - Requester: &HTTPRequester{}, - ForceCheck: true, - } - - fmt.Println("Running Self Update") - err := updater.BackgroundRun() - if err != nil { - fmt.Println(err) - os.Exit(4) - } - }, -} - -func init() { - RootCmd.AddCommand(selfUpdateCmd) -} diff --git a/glide.yaml b/glide.yaml index d0f9847..4d46869 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,28 +1,25 @@ package: github.com/rai-project/rai import: -- package: golang.org/x/sys - version: master -- package: github.com/opencontainers/runc - version: master -- package: github.com/GeertJohan/go-sourcepath -- package: github.com/Unknwon/com - version: ^1.0.0 -- package: github.com/fatih/color -- package: github.com/mitchellh/go-homedir -- package: github.com/pkg/errors - version: ~0.8.0 -- package: github.com/rai-project/auth - subpackages: - - provider -- package: github.com/rai-project/client -- package: github.com/rai-project/cmd -- package: github.com/rai-project/config -- package: github.com/rai-project/logger - subpackages: - - hooks -- package: github.com/sanbornm/go-selfupdate - subpackages: - - selfupdate -- package: github.com/spf13/cobra -- package: github.com/spf13/viper -- package: gopkg.in/yaml.v2 + - package: golang.org/x/sys + version: master + - package: github.com/opencontainers/runc + version: master + - package: github.com/GeertJohan/go-sourcepath + - package: github.com/Unknwon/com + version: ^1.0.0 + - package: github.com/fatih/color + - package: github.com/mitchellh/go-homedir + - package: github.com/pkg/errors + version: ~0.8.0 + - package: github.com/rai-project/auth + subpackages: + - provider + - package: github.com/rai-project/client + - package: github.com/rai-project/cmd + - package: github.com/rai-project/config + - package: github.com/rai-project/logger + subpackages: + - hooks + - package: github.com/spf13/cobra + - package: github.com/spf13/viper + - package: gopkg.in/yaml.v2