Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/hyperhq/hypercli.svg?branch=master)](https://travis-ci.org/hyperhq/hypercli)

Hyper_ client for Mac/Linux
Hyper.sh client for Mac/Linux

How to build
```
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.2
1.10.6
3 changes: 3 additions & 0 deletions api/client/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ func NewDockerCli(in io.ReadCloser, out, err io.Writer, clientFlags *cli.ClientF
if ok {
cloudConfig.AccessKey = cc.AccessKey
cloudConfig.SecretKey = cc.SecretKey
} else {
cloudConfig.AccessKey = os.Getenv("HYPER_ACCESS")
cloudConfig.SecretKey = os.Getenv("HYPER_SECRET")
}
if cloudConfig.AccessKey == "" || cloudConfig.SecretKey == "" {
fmt.Fprintf(cli.err, "WARNING: null cloud config\n")
Expand Down
29 changes: 29 additions & 0 deletions api/client/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,41 @@ func (cli *DockerCli) CmdComposeScale(args ...string) error {
return nil
}

// CmdComposePull
//
// Usage: hyper compose pull [OPTIONS]
func (cli *DockerCli) CmdComposePull(args ...string) error {
cmd := Cli.Subcmd("compose pull", []string{"[SERVICE...]"}, "Pull images of services.", false)
composeFile := cmd.String([]string{"f", "-file"}, "docker-compose.yml", "Specify an alternate compose file")
cmd.Require(flag.Min, 0)
err := cmd.ParseFlags(args, true)
if err != nil {
return err
}
project, err := docker.NewProject(&docker.Context{
Context: project.Context{
ComposeFiles: []string{*composeFile},
},
ClientFactory: cli,
})

if err != nil {
return err
}
err = project.Pull(cmd.Args()...)
if err != nil {
return err
}
return nil
}

func composeUsage() string {
composeCommands := [][]string{
{"create", "Creates containers for a service"},
{"down", "Stop and remove containers, images, and volumes"},
{"kill", "Force stop service containers"},
{"ps", "List containers"},
{"pull", "Pull images of services"},
{"rm", "Remove stopped service containers"},
{"run", "Run a one-off command"},
{"scale", "Set number of containers for a service"},
Expand Down
2 changes: 1 addition & 1 deletion api/client/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (cli *DockerCli) createContainer(ctx context.Context, config *container.Con
//if image not found try to pull it
if err != nil {
if client.IsErrImageNotFound(err) {
fmt.Fprintf(cli.err, "Unable to find image '%s' locally\n", ref.String())
fmt.Fprintf(cli.err, "Unable to find image '%s' in the current region\n", ref.String())

// we don't want to write to stdout anything apart from container.ID
if err = cli.pullImageCustomOut(ctx, config.Image, cli.err); err != nil {
Expand Down
Loading