change the grctl installation directory

This commit is contained in:
barnettZQG 2020-03-11 18:24:59 +08:00
parent f5e047e841
commit 8985e5797f
3 changed files with 11 additions and 9 deletions

View File

@ -66,7 +66,7 @@ func Common(c *cli.Context) {
}
//Common Common
//CommonWithoutRegion Common
func CommonWithoutRegion(c *cli.Context) {
config, err := conf.LoadConfig(c)
if err != nil {

View File

@ -16,11 +16,16 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var pemDirPath = "/opt/rainbond/etc/ssl/region/"
var pemDirPath = ".rbd/ssl"
var clientPemPath = path.Join(pemDirPath, "client.pem")
var clientKeyPemPath = path.Join(pemDirPath, "client.key.pem")
var clientCAPemPath = path.Join(pemDirPath, "ca.pem")
func init() {
homePath, _ := sources.Home()
pemDirPath = path.Join(homePath, pemDirPath)
}
//NewCmdInstall -
func NewCmdInstall() cli.Command {
c := cli.Command{
@ -35,6 +40,7 @@ func NewCmdInstall() cli.Command {
},
Usage: "grctl install",
Action: func(c *cli.Context) error {
fmt.Println("Start install, please waiting!")
CommonWithoutRegion(c)
apiClientSecrit, err := clients.K8SClient.CoreV1().Secrets("rbd-system").Get("rbd-api-client-cert", metav1.GetOptions{})
if err != nil {

View File

@ -2,13 +2,10 @@
set -o errexit
# define package name
WORK_DIR=/go/src/github.com/goodrain/rainbond
BASE_NAME=rainbond
releasedir=./.release
distdir=${releasedir}/dist
GO_VERSION=1.11
VERSION=master
VERSION=$(git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3)
buildTime=$(date +%F-%H)
git_commit=$(git log -n 1 --pretty --format=%h)
release_desc=${VERSION}-${git_commit}-${buildTime}
@ -16,7 +13,6 @@ release_desc=${VERSION}-${git_commit}-${buildTime}
function prepare() {
rm -rf $releasedir
mkdir -pv $releasedir/{tmp,dist}
path=$PWD
[ ! -d "$distdir/usr/local/" ] && mkdir -p $distdir/usr/local/bin
}
@ -24,7 +20,7 @@ build_items=(api builder grctl monitor mq node webcli worker eventlog init-probe
function localbuild() {
if [ "$1" = "all" ];then
for item in ${build_items[@]}
for item in "${build_items[@]}"
do
echo "build local ${item}"
go build -ldflags "-w -s -X github.com/goodrain/rainbond/cmd.version=${release_desc}" -o _output/${GOOS}/${VERSION}/rainbond-$item ./cmd/$item
@ -48,7 +44,7 @@ case $1 in
*)
prepare
if [ "$1" = "all" ];then
for item in ${build_items[@]}
for item in "${build_items[@]}"
do
localbuild $item
done