This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jason McCallister <jason@craftcms.com>
- Loading branch information
1 parent
0742ff4
commit ec5067e
Showing
6 changed files
with
63 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var ( | ||
restartCommand = &cobra.Command{ | ||
Use: "restart", | ||
Short: "Restart services on machine", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return cmd.Help() | ||
}, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/craftcms/nitro/config" | ||
"github.com/craftcms/nitro/internal/nitro" | ||
) | ||
|
||
var ( | ||
restartDatabaseCommand = &cobra.Command{ | ||
Use: "database", | ||
Short: "Restart database", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
name := config.GetString("machine", flagMachineName) | ||
engine := config.GetString("database.engine", flagDatabase) | ||
version := config.GetString("database.version", flagDatabaseVersion) | ||
|
||
return nitro.Run(nitro.NewMultipassRunner("multipass"), nitro.RestartDatabase(name, engine, version)) | ||
}, | ||
} | ||
servicesDatabaseRestartCommand = &cobra.Command{ | ||
Use: "restart", | ||
Short: "Restart the database", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return cmd.Help() | ||
}, | ||
} | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package nitro | ||
|
||
import "fmt" | ||
|
||
func RestartDatabase(name, engine, version string) []Command { | ||
imageName := fmt.Sprintf("nitro_%v_%v", engine, version) | ||
fmt.Println(imageName) | ||
return []Command{ | ||
{ | ||
Machine: name, | ||
Type: "exec", | ||
Args: []string{name, "--", "docker", "restart", imageName}, | ||
}, | ||
} | ||
} |