Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rainbond2
Commits
8985e579
Commit
8985e579
authored
5 years ago
by
barnettZQG
Browse files
Options
Download
Email Patches
Plain Diff
change the grctl installation directory
parent
f5e047e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
grctl/cmd/cmd.go
+1
-1
grctl/cmd/cmd.go
grctl/cmd/install.go
+7
-1
grctl/cmd/install.go
localbuild.sh
+3
-7
localbuild.sh
with
11 additions
and
9 deletions
+11
-9
grctl/cmd/cmd.go
+
1
-
1
View file @
8985e579
...
...
@@ -66,7 +66,7 @@ func Common(c *cli.Context) {
}
//Common Common
//Common
WithoutRegion
Common
func
CommonWithoutRegion
(
c
*
cli
.
Context
)
{
config
,
err
:=
conf
.
LoadConfig
(
c
)
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
grctl/cmd/install.go
+
7
-
1
View file @
8985e579
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
localbuild.sh
+
3
-
7
View file @
8985e579
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help