Merge branch 'release-3.4' of code.goodrain.com:goodrain/rainbond into release-3.4

This commit is contained in:
goodrain 2017-12-11 17:42:02 +08:00
commit a3613620a7
12 changed files with 97 additions and 18 deletions

3
.gitignore vendored
View File

@ -46,4 +46,5 @@ venv/
_output/
hack/deb/ubuntu-trusty
hack/deb/ubuntu-trusty
hack/contrib/docker/node/release.sh

View File

@ -47,4 +47,3 @@ bash -x xxxx <args>
├── install_compute_group.json
└── install_manage_group.json
```

View File

@ -102,11 +102,11 @@ function make_domain() {
IP=$(cat /etc/goodrain/envs/ip.sh | awk -F '=' '{print $2}')
docker pull hub.goodrain.com/dc-deploy/archiver:domain
#docker run -it --rm hub.goodrain.com/dc-deploy/archiver:domain init --ip $IP > /tmp/domain.log
[ -f "/tmp/domain.log" ] && echo "" > /tmp/domain.log || touch /tmp/domain.log
[ -f "/data/.domain.log" ] && echo "" > /data/.domain.log || touch /data/.domain.log
docker run --rm -v /tmp/domain.log:/tmp/domain.log hub.goodrain.com/dc-deploy/archiver:domain init --ip $IP > /tmp/do.log
docker run --rm -v /data/.domain.log:/tmp/domain.log hub.goodrain.com/dc-deploy/archiver:domain init --ip $IP > /tmp/do.log
if [ $? -eq 0 ];then
EX_DOMAIN=$(cat /tmp/domain.log)
EX_DOMAIN=$(cat /data/.domain.log)
else
touch /tmp/fuck
fi

View File

@ -451,7 +451,7 @@ REGIONS = (
# logo path
MEDIA_ROOT = '/data/media'
SN = '30b2owNzc8rJE-Ncmti1aHddSDjZQ3soGyeQ3grb43pCK8Q8_3FdV80fxpFmWeZeKziCl_a3zZiAdO6pmy9xtzCHTPX73yAEa4KuY6Yvu97mS88ID4R0ZAsksxoBvtfIKc7lxMX4ILh7xQoDn9r8QOsb6PQZFwa08373_nKoiIu6JPAZ8srwnpySkzUQilQ4gQGSuwG-NDGV8zJAHwfLc2zCIWtLvOLMEL-5jkq23rrEgfGmyUKln9yFMvRqyaL8ZO025oi901'
SN = '01d1S-WMrCLEKypQ_jCW78MEkB-LqhgMIvZIlK3x9vuS-WlUjMkUG5OK8OCe_4KvrfYptfyc8PWe7adI21D57JnbHMU7paNCLxu4xMCK3ACXO97LifX8EBpkJUdjv8AnK0uZ0qXkoe2t0KFr_3cKfsYyG7F--QniyVElkjp6UJTBqXFU5E88easFVqA4YP9ARCGdbcxlp3ga6rfMq1KlRPv3G73hN4diUvcoP_0aOLbD7v17cuWWRXTfIcP5d1JuDTOHc0z-lGjwVQj4iJesBS1QaD5YpgrsJXzKAvI01'
# log domain
LOG_DOMAIN = {

View File

@ -40,8 +40,11 @@ function image::push() {
fi
log.info "docker pull $IMAGES_NAME_Pb"
docker pull $IMAGES_NAME_Pb
IMAGES_NAME_Pr="goodrain.me/$BASE_NAME:$VERSION"
if [ $BASE_NAME = "adapter" ];then
IMAGES_NAME_Pr="goodrain.me/$BASE_NAME"
else
IMAGES_NAME_Pr="goodrain.me/$BASE_NAME:$VERSION"
fi
docker tag $IMAGES_NAME_Pb $IMAGES_NAME_Pr
docker push $IMAGES_NAME_Pr
}

View File

@ -1,13 +1,25 @@
#!/bin/bash
IP=${1:-127.0.0.1}
IP=$1
DOMAIN=${2:-$(cat /data/.domain.log)}
function run() {
docker run -it --rm hub.goodrain.com/dc-deploy/archiver:domain init --ip $IP > /tmp/domain.log
function domain() {
log.info "update domain"
ex_domain=$(cat /data/.domain.log)
if [ $DOMAIN != $ex_domain ];then
echo "DOMAIN NOT ALLOW"
else
docker run -it --rm hub.goodrain.com/dc-deploy/archiver:domain update --ip $ip --domain $DOMAIN
if [ $? -eq 0 ];then
echo "domain change Success!!!"
else
echo "domain change error!!!"
fi
fi
}
case $1 in
*)
run
domain
;;
esac

View File

@ -46,10 +46,12 @@ func GetCmds() []cli.Command {
//cmds = append(cmds, NewCmdComputeGroup())
cmds = append(cmds, NewCmdInstall())
cmds = append(cmds, NewCmdInstallStatus())
//cmds = append(cmds, NewCmdInstallStatus())
cmds = append(cmds, NewCmdAddTask())
//cmds = append(cmds, NewCmdStatus())
cmds = append(cmds, NewCmdDomain())
//cmds = append(cmds, NewCmdBaseManageGroup())
//cmds = append(cmds, NewCmdManageGroup())

62
pkg/grctl/cmd/domain.go Normal file
View File

@ -0,0 +1,62 @@
// RAINBOND, Application Management Platform
// Copyright (C) 2014-2017 Goodrain Co., Ltd.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. For any non-GPL usage of Rainbond,
// one or multiple Commercial Licenses authorized by Goodrain Co., Ltd.
// must be obtained first.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package cmd
import (
"github.com/urfave/cli"
"fmt"
"bytes"
"os/exec"
)
func NewCmdDomain() cli.Command {
c:=cli.Command{
Name: "domain",
Flags: []cli.Flag{
cli.StringFlag{
Name: "ip",
Usage: "ip address",
},
cli.StringFlag{
Name: "domain",
Usage: "domain",
},
},
Usage: "",
Action: func(c *cli.Context) error {
ip:=c.String("ip")
if len(ip)==0 {
fmt.Println("ip must not null")
return nil
}
domain:=c.String("domain")
cmd := exec.Command("bash", "/usr/share/gr-rainbond-node/gaops/jobs/install/manage/tasks/ex_domain.sh",ip+" "+domain)
outbuf:=bytes.NewBuffer(nil)
cmd.Stdout=outbuf
cmd.Run()
out:=outbuf.String()
fmt.Println(out)
return nil
},
}
return c
}

View File

@ -146,8 +146,10 @@ func initCluster(c *cli.Context) error {
Task(c,"check_manage_base_services",false)
Task(c,"check_manage_services",false)
//done<-1
//一般 job会在通过grctl执行时阻塞输出这种通过 脚本执行的,需要单独查
fmt.Println("install manage node success,next you can :")
fmt.Println(" add compute node--grctl node add -h")
fmt.Println(" install compute node--grctl install compute -h")
fmt.Println(" up compute node--grctl node up -h")
return nil
}

View File

@ -274,7 +274,6 @@ func Status(task string,nodes []string) {
func Task(c *cli.Context,task string,status bool) error {
nodes:=c.StringSlice("nodes")
logrus.Infof("task %s will execute in nodes: %v",task,nodes)
taskEntity,err:=clients.NodeClient.Tasks().Get(task)
if taskEntity==nil||err!=nil {
logrus.Errorf("error get task entity from server,please check server api")

View File

@ -57,7 +57,7 @@ func Routers(mode string) *chi.Mux {
r.Get("/resources", controller.Resources)
r.Get("/", controller.GetNodes)
r.Get("/{rule}", controller.GetRuleNodes)
r.Get("/rule/{rule}", controller.GetRuleNodes)
r.Post("/", controller.NewNode) //增加一个节点
r.Post("/multiple", controller.NewMultipleNode) //增加多个节点
r.Delete("/{node_id}", controller.DeleteRainbondNode) //删除一个节点

View File

@ -8,7 +8,6 @@ DOCKER_PATH=./hack/contrib/docker/$1
BASE_NAME=rainbond
releasedir=./.release
distdir=${releasedir}/dist
#gaops='git@code.goodrain.com:goodrain/gaops.git'
gaopsdir=/hack/contrib/docker/node/gaops