Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
add info to init command
Browse files Browse the repository at this point in the history
Signed-off-by: Jason McCallister <jason@craftcms.com>
  • Loading branch information
jasonmccallister committed Apr 3, 2020
1 parent b99a05a commit fab970e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions internal/nitro/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,8 @@ func Init(name, cpus, memory, disk, php, db, version string) []Command {
Args: dockerCommands,
})

// show info
commands = append(commands, Info(name)...)

return commands
}
18 changes: 14 additions & 4 deletions internal/nitro/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package nitro
import (
"reflect"
"testing"

"github.com/craftcms/nitro/command"
)

func TestInit(t *testing.T) {
Expand Down Expand Up @@ -38,7 +36,7 @@ func TestInit(t *testing.T) {
Machine: "thisname",
Type: "launch",
Chainable: true,
Input: command.CloudInit,
Input: cloudConfig,
Args: []string{"--name", "thisname", "--cpus", "4", "--mem", "4G", "--disk", "20G", "--cloud-init", "-"},
},
{
Expand All @@ -53,6 +51,12 @@ func TestInit(t *testing.T) {
Chainable: true,
Args: []string{"thisname", "--", "docker", "run", "-d", "--restart=always", "-p", "3306:3306", "-e", "MYSQL_ROOT_PASSWORD=nitro", "-e", "MYSQL_DATABASE=nitro", "-e", "MYSQL_USER=nitro", "-e", "MYSQL_PASSWORD=nitro", "mysql:5.7"},
},
{
Machine: "thisname",
Type: "info",
Chainable: true,
Args: []string{"thisname"},
},
},
},
{
Expand All @@ -71,7 +75,7 @@ func TestInit(t *testing.T) {
Machine: "thisname",
Type: "launch",
Chainable: true,
Input: command.CloudInit,
Input: cloudConfig,
Args: []string{"--name", "thisname", "--cpus", "4", "--mem", "4G", "--disk", "20G", "--cloud-init", "-"},
},
{
Expand All @@ -86,6 +90,12 @@ func TestInit(t *testing.T) {
Chainable: true,
Args: []string{"thisname", "--", "docker", "run", "-d", "--restart=always", "-p", "5432:5432", "-e", "POSTGRES_PASSWORD=nitro", "-e", "POSTGRES_USER=nitro", "-e", "POSTGRES_DB=nitro", "postgres:11.5"},
},
{
Machine: "thisname",
Type: "info",
Chainable: true,
Args: []string{"thisname"},
},
},
},
}
Expand Down

0 comments on commit fab970e

Please # to comment.