-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from MZC-CSC/develop
docker command deleted and added infra and update command
- Loading branch information
Showing
8 changed files
with
108 additions
and
44 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
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
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,47 @@ | ||
package docker | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/cm-mayfly/cm-mayfly/common" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// pullCmd represents the pull command | ||
var updateCmd = &cobra.Command{ | ||
Use: "update", | ||
Short: "Update the latest Docker images of the subsystems that make up the Cloud-Migrator system.", | ||
Long: `Update the latest Docker images of the subsystems that make up the Cloud-Migrator system.`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("\n[Update the Docker images of the subsystems that make up the Cloud-Migrator system.]") | ||
//============================ | ||
// Pull | ||
//============================ | ||
fmt.Println("[Install the latest Docker images of the Cloud-Migrator subsystems.]") | ||
fmt.Println() | ||
|
||
cmdStr := fmt.Sprintf("COMPOSE_PROJECT_NAME=%s docker compose -f %s pull %s", ProjectName, DockerFilePath, ServiceName) | ||
//fmt.Println(cmdStr) | ||
common.SysCall(cmdStr) | ||
|
||
//============================ | ||
// RUN | ||
//============================ | ||
fmt.Println("\n\n[Restart based on the installed latest Docker images.]") | ||
fmt.Println() | ||
|
||
detachModeOption := "" | ||
if DetachMode { | ||
detachModeOption = "-d" | ||
} | ||
cmdStr = fmt.Sprintf("COMPOSE_PROJECT_NAME=%s docker compose -f %s up %s %s", ProjectName, DockerFilePath, detachModeOption, ServiceName) | ||
|
||
//fmt.Println(cmdStr) | ||
common.SysCall(cmdStr) | ||
|
||
}, | ||
} | ||
|
||
func init() { | ||
dockerCmd.AddCommand(updateCmd) | ||
} |
Binary file not shown.
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