From cd2585fca8d9c2acea6b6f95364552799888bfa0 Mon Sep 17 00:00:00 2001 From: Cyril Diagne Date: Fri, 25 Oct 2019 13:32:16 +0200 Subject: [PATCH] Minor cleanup --- cmd/app-delete.go | 2 -- cmd/app-deploy.go | 5 +---- cmd/app-dev.go | 7 +++---- cmd/setup.go | 2 +- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cmd/app-delete.go b/cmd/app-delete.go index de5ab0f..2af4054 100644 --- a/cmd/app-delete.go +++ b/cmd/app-delete.go @@ -49,14 +49,12 @@ func delete(app string) error { image := viper.GetString("image") // Command to run. command := []string{"kuda_app_delete", app} - // Add the CWD to the volumes mounted in Docker. dir, err := os.Getwd() if err != nil { panic(err) } volumes := []string{dir + ":/app_home"} - // Run the command. dockerErr := RunDockerWithEnvs(docker.CommandOption{ Image: image, diff --git a/cmd/app-deploy.go b/cmd/app-deploy.go index 7ea38ed..5328d58 100644 --- a/cmd/app-deploy.go +++ b/cmd/app-deploy.go @@ -62,20 +62,17 @@ func init() { } func deploy(app string, appDir string) error { - fmt.Println("→ Deploying app...") // Image to run. image := viper.GetString("image") // Command to run. command := []string{"kuda_app_deploy", app} - // Add the application folder to the volumes mounted in Docker. volumes := []string{ // Bind the app home directory. appDir + ":/app_home", - // Bind docker socker for Skaffold. + // Bind local docker socket for Skaffold. "/var/run/docker.sock:/var/run/docker.sock", } - // Run the command. dockerErr := RunDockerWithEnvs(docker.CommandOption{ Image: image, diff --git a/cmd/app-dev.go b/cmd/app-dev.go index f1b15d9..e68e919 100644 --- a/cmd/app-dev.go +++ b/cmd/app-dev.go @@ -61,17 +61,16 @@ func init() { appCmd.AddCommand(appDevCmd) } -func dev(appName string, appDir string) error { - fmt.Println("→ Start app dev...") +func dev(app string, appDir string) error { // Image to run. image := viper.GetString("image") // Command to run. - command := []string{"kuda_app_dev", appName} + command := []string{"kuda_app_dev", app} // Add the application folder to the volumes mounted in Docker. volumes := []string{ // Bind the app home directory. appDir + ":/app_home", - // Bind docker socker for Skaffold. + // Bind local docker socket for Skaffold. "/var/run/docker.sock:/var/run/docker.sock", } // Run the command. diff --git a/cmd/setup.go b/cmd/setup.go index 54fec5b..961cedc 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -47,7 +47,7 @@ func Setup() error { // Run err := RunDockerWithEnvs(docker.CommandOption{Image: image, Command: command}) if err != nil { - panic(err) + panic("There was an error setting up the cluster.") } // Write new config to home directory.