|
@@ -274,17 +274,18 @@ function init:add_user() {
|
|
|
function init:git() {
|
|
|
log::info "[git]" "安装git环境..."
|
|
|
local host="127.0.0.1"
|
|
|
+ local exc_cmd = "git config --global credential.helper store"
|
|
|
command::exec "${host}" "
|
|
|
yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
|
|
|
yum -y install git
|
|
|
git --version
|
|
|
- git config --global credential.helper store
|
|
|
+ $exc_cmd
|
|
|
"
|
|
|
check::exit_code "$?" "git" "$host 安装git环境" "exit"
|
|
|
log::info "[git]" "git环境安装成功!"
|
|
|
if [[ "${ADD_USER_TAG:-}" == "1" ]]; then
|
|
|
command::exec "${host}" "
|
|
|
- echo '${ADD_USER_PASSWORD}' | su - ${ADD_USER_NAME} -c \"git config --global credential.helper store\"
|
|
|
+ echo '${ADD_USER_PASSWORD}' | su - ${ADD_USER_NAME} -c \"$exc_cmd\"
|
|
|
"
|
|
|
check::exit_code "$?" "git" "$host git配置" "exit"
|
|
|
log::info "[git]" "git配置成功!"
|
|
@@ -332,27 +333,38 @@ function init:nginx() {
|
|
|
function init:nodejs() {
|
|
|
log::info "[nodejs]" "安装nodejs环境..."
|
|
|
local host="127.0.0.1"
|
|
|
+ local exc_cmd = "
|
|
|
+ # 配置npm源
|
|
|
+ npm config set registry https://registry.npm.taobao.org
|
|
|
+ npm config set disturl https://npm.taobao.org/dist
|
|
|
+ npm config set electron_mirror https://npm.taobao.org/mirrors/electron/
|
|
|
+ npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
|
|
|
+ npm config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/
|
|
|
+ # 配置yarn源
|
|
|
+ yarn config set registry https://registry.npm.taobao.org -g
|
|
|
+ yarn config set disturl https://npm.taobao.org/dist -g
|
|
|
+ yarn config set electron_mirror https://npm.taobao.org/mirrors/electron/ -g
|
|
|
+ yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ -g
|
|
|
+ yarn config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/ -g
|
|
|
+ yarn config set chromedriver_cdnurl https://cdn.npm.taobao.org/dist/chromedriver -g
|
|
|
+ yarn config set operadriver_cdnurl https://cdn.npm.taobao.org/dist/operadriver -g
|
|
|
+ yarn config set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents -g
|
|
|
+ "
|
|
|
command::exec "${host}" "
|
|
|
curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash -
|
|
|
yum -y install nodejs
|
|
|
npm install --global yarn
|
|
|
- # 配置npm源
|
|
|
- npm config set registry https://registry.npm.taobao.org
|
|
|
- npm config set disturl https://npm.taobao.org/dist
|
|
|
- npm config set electron_mirror https://npm.taobao.org/mirrors/electron/
|
|
|
- npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
|
|
|
- npm config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/
|
|
|
- # 配置yarn源
|
|
|
- yarn config set registry https://registry.npm.taobao.org -g
|
|
|
- yarn config set disturl https://npm.taobao.org/dist -g
|
|
|
- yarn config set electron_mirror https://npm.taobao.org/mirrors/electron/ -g
|
|
|
- yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ -g
|
|
|
- yarn config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/ -g
|
|
|
- yarn config set chromedriver_cdnurl https://cdn.npm.taobao.org/dist/chromedriver -g
|
|
|
- yarn config set operadriver_cdnurl https://cdn.npm.taobao.org/dist/operadriver -g
|
|
|
- yarn config set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents -g
|
|
|
+ $exc_cmd
|
|
|
"
|
|
|
check::exit_code "$?" "nodejs" "$host 安装nodejs环境" "exit"
|
|
|
+ exc_cmd="$(utils::quote "$exc_cmd")"
|
|
|
+ if [[ "${ADD_USER_TAG:-}" == "1" ]]; then
|
|
|
+ command::exec "${host}" "
|
|
|
+ echo '${ADD_USER_PASSWORD}' | su - ${ADD_USER_NAME} -c \"$exc_cmd\"
|
|
|
+ "
|
|
|
+ check::exit_code "$?" "nodejs" "$host nodejs配置" "exit"
|
|
|
+ log::info "[nodejs]" "nodejs配置成功!"
|
|
|
+ fi
|
|
|
log::info "[nodejs]" "安装nodejs环境成功!"
|
|
|
}
|
|
|
|