Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
servers_config
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
servers_config
Commits
c468d949
Commit
c468d949
authored
Jul 16, 2018
by
ifool
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update setup_script.rb and setup.rb
parent
2b7e2411
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
setup.rb
+1
-1
setup_script.rb
+5
-3
No files found.
setup.rb
View file @
c468d949
...
@@ -4,7 +4,7 @@ require 'json'
...
@@ -4,7 +4,7 @@ require 'json'
def
download_server_json
def
download_server_json
product_name
=
ARGV
[
0
]
product_name
=
ARGV
[
0
]
config_root
=
File
.
expand_path
(
'..'
,
__FILE__
)
config_root
=
File
.
expand_path
(
'..'
,
__FILE__
)
git_branch
=
`git rev-parse --abbrev-ref HEAD`
.
chop
git_branch
=
`
cd
#{
config_root
}
;
git rev-parse --abbrev-ref HEAD`
.
chop
dir_basename
=
File
.
basename
config_root
dir_basename
=
File
.
basename
config_root
server_conf_url
=
"http://gitlab.ikcrm.com/ikcrm_common/servers_config/raw/master/
#{
product_name
}
/
#{
git_branch
}
_
#{
dir_basename
}
/server.json"
server_conf_url
=
"http://gitlab.ikcrm.com/ikcrm_common/servers_config/raw/master/
#{
product_name
}
/
#{
git_branch
}
_
#{
dir_basename
}
/server.json"
puts
"Use server config url:
#{
server_conf_url
}
"
puts
"Use server config url:
#{
server_conf_url
}
"
...
...
setup_script.rb
View file @
c468d949
...
@@ -2,14 +2,16 @@
...
@@ -2,14 +2,16 @@
product_name
=
ARGV
[
0
]
# crm, jxc, bms
product_name
=
ARGV
[
0
]
# crm, jxc, bms
dir_name
=
ARGV
[
1
]
# dev, test, staging, prod
dir_name
=
ARGV
[
1
]
# dev, test, staging, prod
config_root
=
File
.
expand_path
(
"../
#{
dir_name
}
"
,
__FILE__
)
if
dir_name
.
nil?
if
dir_name
.
nil?
raise
"Dir name is required!"
raise
"Dir name is required!"
elsif
!
Dir
.
exists?
(
dir_name
)
elsif
!
Dir
.
exists?
(
config_root
)
raise
"Dir:
#{
dir_name
}
not exists!"
raise
"Dir:
#{
config_root
}
not exists!"
end
end
puts
"======================= config_root is:
#{
config_root
}
======================="
git_config_url
=
"http://gitlab.ikcrm.com/ikcrm_common/servers_config/raw/master"
git_config_url
=
"http://gitlab.ikcrm.com/ikcrm_common/servers_config/raw/master"
config_root
=
File
.
expand_path
(
"../
#{
dir_name
}
"
,
__FILE__
)
setup_url
=
"
#{
git_config_url
}
/setup.rb"
setup_url
=
"
#{
git_config_url
}
/setup.rb"
puts
"Use setup url:
#{
setup_url
}
"
puts
"Use setup url:
#{
setup_url
}
"
system
"curl
#{
setup_url
}
>
#{
config_root
}
/setup.rb"
system
"curl
#{
setup_url
}
>
#{
config_root
}
/setup.rb"
...
...
Write
Preview
Markdown
is supported
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