Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrildiagne committed Oct 25, 2019
1 parent 6173633 commit cd2585f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 0 additions & 2 deletions cmd/app-delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 1 addition & 4 deletions cmd/app-deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions cmd/app-dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit cd2585f

Please sign in to comment.