mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-04 20:57:38 +08:00
Merge branch 'V3.7' of https://github.com/goodrain/rainbond into V3.7
This commit is contained in:
commit
ce6f4a56d7
@ -38,10 +38,6 @@ func NewCmdInit() cli.Command {
|
|||||||
c := cli.Command{
|
c := cli.Command{
|
||||||
Name: "init",
|
Name: "init",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.StringFlag{
|
|
||||||
Name: "etcd",
|
|
||||||
Usage: "etcd ip,127.0.0.1",
|
|
||||||
},
|
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "type",
|
Name: "type",
|
||||||
Usage: "node type: manage or compute",
|
Usage: "node type: manage or compute",
|
||||||
@ -53,8 +49,14 @@ func NewCmdInit() cli.Command {
|
|||||||
Value: "/opt/rainbond/install",
|
Value: "/opt/rainbond/install",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "mip",
|
Name: "iip",
|
||||||
Usage: "当前节点内网IP, 10.0.0.1",
|
Usage: "manage01 local ip",
|
||||||
|
Value: "",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "eip",
|
||||||
|
Usage: "manage01 public ip",
|
||||||
|
Value: "0.0.0.0",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "rainbond-version",
|
Name: "rainbond-version",
|
||||||
@ -66,6 +68,11 @@ func NewCmdInit() cli.Command {
|
|||||||
Usage: "defalut online.",
|
Usage: "defalut online.",
|
||||||
Value: "online",
|
Value: "online",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "domain",
|
||||||
|
Usage: "defalut custom apps domain.",
|
||||||
|
Value: "",
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "test",
|
Name: "test",
|
||||||
Usage: "use test shell",
|
Usage: "use test shell",
|
||||||
@ -143,7 +150,7 @@ func initCluster(c *cli.Context) {
|
|||||||
|
|
||||||
// start setup script to install rainbond
|
// start setup script to install rainbond
|
||||||
fmt.Println("Begin init cluster first node,please don't exit,wait install")
|
fmt.Println("Begin init cluster first node,please don't exit,wait install")
|
||||||
cmd := exec.Command("bash", "-c", fmt.Sprintf("cd %s ; ./setup.sh %s %s", c.String("work_dir"), c.String("install-type"), c.String("rainbond-version")))
|
cmd := exec.Command("bash", "-c", fmt.Sprintf("cd %s ; ./setup.sh %s %s %s", c.String("work_dir"), c.String("install-type"), c.String("eip"), c.String("domain")))
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
cmd.Stdin = os.Stdin
|
cmd.Stdin = os.Stdin
|
||||||
|
@ -139,7 +139,7 @@ func handleResult(serviceTable *termtables.Table, v *client.HostNode) {
|
|||||||
if v.Type == client.OutOfDisk || v.Type == client.MemoryPressure || v.Type == client.DiskPressure || v.Type == client.InstallNotReady {
|
if v.Type == client.OutOfDisk || v.Type == client.MemoryPressure || v.Type == client.DiskPressure || v.Type == client.InstallNotReady {
|
||||||
formatReady = "\033[0;32;32m false \033[0m"
|
formatReady = "\033[0;32;32m false \033[0m"
|
||||||
} else {
|
} else {
|
||||||
formatReady = "\033[0;31;31m false \033[0m"
|
formatReady = "\033[0;31;31m true \033[0m"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
formatReady = "\033[0;32;32m true \033[0m"
|
formatReady = "\033[0;32;32m true \033[0m"
|
||||||
@ -284,8 +284,8 @@ func NewCmdNode() cli.Command {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "unscheduable",
|
Name: "cordon",
|
||||||
Usage: "unscheduable hostID",
|
Usage: "Mark node as unschedulable",
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
Common(c)
|
Common(c)
|
||||||
id := c.Args().First()
|
id := c.Args().First()
|
||||||
@ -305,8 +305,8 @@ func NewCmdNode() cli.Command {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "rescheduable",
|
Name: "uncordon",
|
||||||
Usage: "rescheduable hostID",
|
Usage: "Mark node as schedulable",
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
Common(c)
|
Common(c)
|
||||||
id := c.Args().First()
|
id := c.Args().First()
|
||||||
|
@ -14,6 +14,8 @@ GetOptions(
|
|||||||
"tenant_id|tid=s" => \$tenant_id,
|
"tenant_id|tid=s" => \$tenant_id,
|
||||||
"service_id|sid=s" => \$service_id,
|
"service_id|sid=s" => \$service_id,
|
||||||
"envs|e=s" => \$envs,
|
"envs|e=s" => \$envs,
|
||||||
|
"runtime|r=s" => \$runtime,
|
||||||
|
"lang|g=s" => \$lang,
|
||||||
"server_type|st=s" => \$server_type
|
"server_type|st=s" => \$server_type
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -27,10 +29,10 @@ chdir($source_dir);
|
|||||||
#system("git archive master | docker run -i --rm -v $cache_dir:/tmp/cache:rw -a stdin -a stdout goodrain.net/builder - >$package_file");
|
#system("git archive master | docker run -i --rm -v $cache_dir:/tmp/cache:rw -a stdin -a stdout goodrain.net/builder - >$package_file");
|
||||||
#system("git archive master | docker run -i --rm -a stdin -a stdout -e SLUG_VERSION=$version -v $slug_dir:/tmp/slug -v $cache_dir:/tmp/cache goodrain.me/builder local >$logfile");
|
#system("git archive master | docker run -i --rm -a stdin -a stdout -e SLUG_VERSION=$version -v $slug_dir:/tmp/slug -v $cache_dir:/tmp/cache goodrain.me/builder local >$logfile");
|
||||||
if ($server_type eq "svn"){
|
if ($server_type eq "svn"){
|
||||||
$cmd="tar -c --exclude=.svn ./ | $docker_bin run -i --net=host --rm --name $name -v $cache_dir:/tmp/cache:rw -a stdin -a stdout $APPEND_ENV_STRING -e SLUG_VERSION=$version -e SERVICE_ID=$service_id -e TENANT_ID=$tenant_id -v $slug_dir:/tmp/slug goodrain.me/builder local";
|
$cmd="tar -c --exclude=.svn ./ | $docker_bin run -i --net=host --rm --name $name -v $cache_dir:/tmp/cache:rw -a stdin -a stdout $APPEND_ENV_STRING -e SLUG_VERSION=$version -e SERVICE_ID=$service_id -e TENANT_ID=$tenant_id -e RUNTIME=$runtime -e LANG=$lang -v $slug_dir:/tmp/slug goodrain.me/builder local";
|
||||||
system($cmd);
|
system($cmd);
|
||||||
}elsif ($server_type eq "git"){
|
}elsif ($server_type eq "git"){
|
||||||
$cmd="git archive $branch | $docker_bin run -i --net=host --rm --name $name -v $cache_dir:/tmp/cache:rw -a stdin -a stdout $APPEND_ENV_STRING -e SLUG_VERSION=$version -e SERVICE_ID=$service_id -e TENANT_ID=$tenant_id -v $slug_dir:/tmp/slug goodrain.me/builder local";
|
$cmd="git archive $branch | $docker_bin run -i --net=host --rm --name $name -v $cache_dir:/tmp/cache:rw -a stdin -a stdout $APPEND_ENV_STRING -e SLUG_VERSION=$version -e SERVICE_ID=$service_id -e TENANT_ID=$tenant_id -e RUNTIME=$runtime -e LANG=$lang -v $slug_dir:/tmp/slug goodrain.me/builder local";
|
||||||
system($cmd);
|
system($cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user