-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0008821
commit 7f10ea9
Showing
7 changed files
with
127 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cmd | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
//NewDeployCommand create new cobra command for the init command | ||
func NewDeployCommand() *cobra.Command { | ||
command := &cobra.Command{ | ||
Use: "deploy -f <deployment_sami_file>", | ||
Short: "deloy your service by given the deployment sami file", | ||
Long: `deloy your service by given the deployment sami file | ||
example: sami deploy -f <deploy-path>/<sami.yaml> | ||
`, | ||
Args: cobra.ExactArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
deployFolder := args[0] | ||
|
||
if err := deployCommand(deployFolder); err != nil { | ||
fmt.Printf("Error: %s\n", err) | ||
return | ||
} | ||
}, | ||
} | ||
|
||
return command | ||
} | ||
|
||
func deployCommand(deployFolder string) error { | ||
// will add the deployment process here... | ||
return errors.New("") | ||
} |
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,27 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
//NewCommand returns a new sami cobra command | ||
func NewCommand() *cobra.Command { | ||
var samiCommand = &cobra.Command{ | ||
Use: "sami", | ||
Short: "sami helps you deploy your services to any target machine", | ||
Long: `sami helps you deploy your services to any target machine`, | ||
} | ||
|
||
// deploy | ||
// samiCommand.AddCommand(NewDeployCommand()) | ||
|
||
// logs | ||
// samiCommand.AddCommand(NewLogsCommand()) | ||
|
||
// oob | ||
// samiCommand.AddCommand(NewOobCommand()) | ||
|
||
// status | ||
// samiCommand.AddCommand(NewStatusCommand()) | ||
return samiCommand | ||
} |
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,12 @@ | ||
|
||
|
||
service_name: "camerdevs" | ||
type: "swarm" | ||
|
||
files: | ||
- ./stack.yaml | ||
|
||
oob: | ||
- update-image: | ||
file: "./stack.yaml" | ||
zigzag: 1 |
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,12 @@ | ||
version: v1beta | ||
|
||
|
||
service_name: "camerdevs" | ||
type: "swarm" | ||
files: | ||
- ./stack.yaml | ||
|
||
oob: | ||
- update-image: | ||
file: "./stack.yaml" | ||
path: ".services.frontend.image" |
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,10 @@ | ||
module github.com/osscameroon/sami | ||
|
||
go 1.17 | ||
|
||
require github.com/spf13/cobra v1.4.0 | ||
|
||
require ( | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
) |
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,10 @@ | ||
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | ||
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= | ||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= | ||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= | ||
github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= | ||
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= | ||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= | ||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= |
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,20 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/osscameroon/sami/sami-cli/cmd" | ||
) | ||
|
||
var version = "0.0.0+dev" | ||
|
||
func main() { | ||
command := cmd.NewCommand() | ||
|
||
err := command.Execute() | ||
if err != nil { | ||
os.Exit(1) | ||
} | ||
|
||
os.Exit(0) | ||
} |