Skip to content

Commit 74f5229

Browse files
committed
feat(deisctl) : working version of updater latest
1 parent 3979beb commit 74f5229

5 files changed

Lines changed: 8 additions & 12 deletions

File tree

cmd/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ func List(c client.Client) error {
1616

1717
func PullImage(service string) error {
1818
dockercli, _, _ := utils.GetNewClient()
19-
fmt.Println("pulling image :" + strings.Split(service, ".")[0])
20-
err := utils.PullImage(dockercli, strings.Split(service, ".")[0])
19+
fmt.Println("pulling image :" + strings.Replace(strings.Split(service, ".")[0], "-", "/", 1) + ":latest")
20+
err := utils.PullImage(dockercli, strings.Replace(strings.Split(service, ".")[0], "-", "/", 1)+":latest")
2121
if err != nil {
2222
return err
2323
}

deisctl

-9.58 MB
Binary file not shown.

deisctl.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ func Update(args []string) {
3333
"--clients-per-app=1",
3434
"--min-sleep=5",
3535
"--max-sleep=10",
36-
"--app-id=" + os.Getenv("DEIS_APP_ID"),
37-
"--group-id=" + os.Getenv("DEIS_GROUP_ID"),
38-
"--version=1.1.0",
3936
}
4037
updatectl.Update(Args)
4138
}

updatectl/update.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func init() {
7373
out = new(tabwriter.Writer)
7474
out.Init(os.Stdout, 0, 8, 1, '\t', 0)
7575
server := "http://localhost:8000" // default server
76-
if serverEnv := os.Getenv("UPDATECTL_SERVER"); serverEnv != "" {
76+
if serverEnv := os.Getenv("DEISCTL_SERVER"); serverEnv != "" {
7777
server = serverEnv
7878
}
7979

@@ -83,8 +83,8 @@ func init() {
8383
globalFlagSet.BoolVar(&globalFlags.Version, "version", false, "Print version information and exit.")
8484
globalFlagSet.BoolVar(&globalFlags.Help, "help", false, "Print usage information and exit.")
8585
globalFlagSet.BoolVar(&globalFlags.SkipSSLVerify, "skip-ssl-verify", false, "Don't check SSL certificates.")
86-
globalFlagSet.StringVar(&globalFlags.User, "user", os.Getenv("UPDATECTL_USER"), "API Username")
87-
globalFlagSet.StringVar(&globalFlags.Key, "key", os.Getenv("UPDATECTL_KEY"), "API Key")
86+
globalFlagSet.StringVar(&globalFlags.User, "user", os.Getenv("DEISCTL_USER"), "API Username")
87+
globalFlagSet.StringVar(&globalFlags.Key, "key", os.Getenv("DEISCTL_KEY"), "API Key")
8888

8989
commands = []*Command{
9090
cmdInstance,
@@ -178,12 +178,11 @@ func Update(Args []string) {
178178
os.Exit(ERROR_NO_COMMAND)
179179
}
180180
if cmd.Run == nil {
181-
// printCommandUsage(cmd)
182181
os.Exit(ERROR_USAGE)
183182
} else {
184183
exit := handle(cmd.Run)(&cmd.Flags)
185184
if exit == ERROR_USAGE {
186-
// printCommandUsage(cmd)
185+
fmt.Println("Please check the arguments")
187186
}
188187
os.Exit(exit)
189188
}

utils/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ func Chdir(app string) error {
113113

114114
func Extract(file, dir string) {
115115
var wd, _ = os.Getwd()
116-
Chdir(dir)
116+
_ = os.Chdir(dir)
117117
cmdl := exec.Command("tar", "-xvf", file)
118118
if _, _, err := RunCommandWithStdoutStderr(cmdl); err != nil {
119119
fmt.Printf("Failed:\n%v", err)
120120
} else {
121121
fmt.Println("ok")
122122
}
123-
Chdir(wd)
123+
_ = os.Chdir(wd)
124124
}
125125

126126
// Rmdir removes a directory and its contents.

0 commit comments

Comments
 (0)