Merge branch 'V3.7' of https://github.com/goodrain/rainbond into V3.7

This commit is contained in:
barnettZQG 2018-08-21 11:43:10 +08:00
commit ce6f4a56d7
3 changed files with 23 additions and 14 deletions

View File

@ -38,10 +38,6 @@ func NewCmdInit() cli.Command {
c := cli.Command{
Name: "init",
Flags: []cli.Flag{
cli.StringFlag{
Name: "etcd",
Usage: "etcd ip,127.0.0.1",
},
cli.StringFlag{
Name: "type",
Usage: "node type: manage or compute",
@ -53,8 +49,14 @@ func NewCmdInit() cli.Command {
Value: "/opt/rainbond/install",
},
cli.StringFlag{
Name: "mip",
Usage: "当前节点内网IP, 10.0.0.1",
Name: "iip",
Usage: "manage01 local ip",
Value: "",
},
cli.StringFlag{
Name: "eip",
Usage: "manage01 public ip",
Value: "0.0.0.0",
},
cli.StringFlag{
Name: "rainbond-version",
@ -66,6 +68,11 @@ func NewCmdInit() cli.Command {
Usage: "defalut online.",
Value: "online",
},
cli.StringFlag{
Name: "domain",
Usage: "defalut custom apps domain.",
Value: "",
},
cli.BoolFlag{
Name: "test",
Usage: "use test shell",
@ -143,7 +150,7 @@ func initCluster(c *cli.Context) {
// start setup script to install rainbond
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.Stderr = os.Stderr
cmd.Stdin = os.Stdin

View File

@ -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 {
formatReady = "\033[0;32;32m false \033[0m"
} else {
formatReady = "\033[0;31;31m false \033[0m"
formatReady = "\033[0;31;31m true \033[0m"
}
} else {
formatReady = "\033[0;32;32m true \033[0m"
@ -284,8 +284,8 @@ func NewCmdNode() cli.Command {
},
},
{
Name: "unscheduable",
Usage: "unscheduable hostID",
Name: "cordon",
Usage: "Mark node as unschedulable",
Action: func(c *cli.Context) error {
Common(c)
id := c.Args().First()
@ -305,8 +305,8 @@ func NewCmdNode() cli.Command {
},
},
{
Name: "rescheduable",
Usage: "rescheduable hostID",
Name: "uncordon",
Usage: "Mark node as schedulable",
Action: func(c *cli.Context) error {
Common(c)
id := c.Args().First()

View File

@ -14,6 +14,8 @@ GetOptions(
"tenant_id|tid=s" => \$tenant_id,
"service_id|sid=s" => \$service_id,
"envs|e=s" => \$envs,
"runtime|r=s" => \$runtime,
"lang|g=s" => \$lang,
"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 -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"){
$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);
}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);
}