diff --git a/VERSION b/VERSION index faef31a..a3df0a6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.0 +0.8.0 diff --git a/cli/commands/start.go b/cli/commands/start.go index 86ab9d4..8458c14 100644 --- a/cli/commands/start.go +++ b/cli/commands/start.go @@ -50,6 +50,17 @@ func (s Start) action() func(c *cli.Context) error { log.Println("Verbose logging is enabled") } + saveState := c.Bool("ss") + if saveState { + log.Println("Save state is enabled, existing environment will not be destroyed") + } else { + log.Printf( + "Save state is %s, existing environment will be %s", + color.RedString("disabled"), + color.RedString("destroyed"), + ) + } + ctx := context.Background() cli, err := client.NewEnvClient() if err != nil { @@ -66,17 +77,6 @@ func (s Start) action() func(c *cli.Context) error { return err } - saveState := c.Bool("ss") - if saveState { - log.Println("Save state is enabled, existing environment will not be destroyed") - } else { - log.Printf( - "Save state is %s, existing environment will be %s", - color.RedString("disabled"), - color.RedString("destroyed"), - ) - } - // TODO return nil diff --git a/cli/services/docker.go b/cli/services/docker.go index 938385e..157534c 100644 --- a/cli/services/docker.go +++ b/cli/services/docker.go @@ -2,9 +2,9 @@ package services import ( "fmt" - "io" - "os" + "log" + "github.com/CityOfZion/neo-local/cli/logger" "github.com/docker/docker/api/types" "github.com/docker/docker/client" "golang.org/x/net/context" @@ -23,14 +23,20 @@ func CheckDockerRunning(ctx context.Context, cli *client.Client) bool { // PullDockerImages pulls each Docker image required for the stack // sequentially. func PullDockerImages(ctx context.Context, cli *client.Client) error { + log.Println("Pulling Docker images") + for _, imageName := range dockerImageNames() { + prefix := fmt.Sprintf("↪ %s", imageName) + s := logger.NewSpinner(prefix) + s.Start() + reader, err := cli.ImagePull(ctx, imageName, types.ImagePullOptions{}) if err != nil { return fmt.Errorf("Error when pulling Docker image '%s': %s", imageName, err) } defer reader.Close() - io.Copy(os.Stdout, reader) + s.Stop() } return nil @@ -38,10 +44,10 @@ func PullDockerImages(ctx context.Context, cli *client.Client) error { func dockerImageNames() []string { return []string{ - "cityofzion/neo-local-faucet", + "cityofzion/neo-local-faucet:latest", "cityofzion/neo-privatenet:2.7.6", "cityofzion/neo-python:v0.7.8", "postgres:10.1", - "registry.gitlab.com/cityofzion/neo-scan", + "registry.gitlab.com/cityofzion/neo-scan:latest", } }