run command for client side added
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,5 +1,5 @@
|
|||||||
build:
|
build:
|
||||||
go build -o bin/main *.go
|
go build -o bin/main main.go
|
||||||
|
|
||||||
run:
|
run:
|
||||||
go run main.go
|
go run main.go
|
||||||
37
main.go
37
main.go
@@ -9,9 +9,12 @@ import (
|
|||||||
|
|
||||||
// VERSION specifies the version of the platform
|
// VERSION specifies the version of the platform
|
||||||
var VERSION = "0.0.1"
|
var VERSION = "0.0.1"
|
||||||
|
var mode string
|
||||||
|
|
||||||
|
// Varaibles if mode is client
|
||||||
|
var OS, Pull_location ,Run_script string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var mode string
|
|
||||||
|
|
||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
Name: "p2p-redering-computation",
|
Name: "p2p-redering-computation",
|
||||||
@@ -24,6 +27,33 @@ func main() {
|
|||||||
Usage: "Specifies mode of running",
|
Usage: "Specifies mode of running",
|
||||||
Destination: &mode,
|
Destination: &mode,
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
|
Flags if the client mode is selected:
|
||||||
|
------------------------------------------------------------------
|
||||||
|
OS: Operating system name to create the VM
|
||||||
|
Pull Location: Location to pull the OS image
|
||||||
|
run script: Script to run the task (i.e binary file preferred)
|
||||||
|
------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "OS",
|
||||||
|
Value: "ubuntu",
|
||||||
|
Usage: "Operating system name to create the VM",
|
||||||
|
Destination: &OS,
|
||||||
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "Pull_location",
|
||||||
|
Value: "http://releases.ubuntu.com/14.04.3/ubuntu-14.04.3-server-amd64.iso",
|
||||||
|
Usage: "Location to pull the OS image",
|
||||||
|
Destination: &Pull_location,
|
||||||
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "Run_script",
|
||||||
|
Value: "None",
|
||||||
|
Usage: "Script to run the task (i.e binary file preferred)",
|
||||||
|
Destination: &Run_script,
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
/*
|
/*
|
||||||
@@ -39,9 +69,8 @@ func main() {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
*/
|
*/
|
||||||
fmt.Println(mode)
|
if Run_script == "None" {
|
||||||
if c.NArg() < 0 {
|
fmt.Println("script not excuted as run script not selected")
|
||||||
fmt.Println(c.Args().Get(0))
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user