refactor: Change the way to install nodejs and yarn
1. Change the way to install nodejs and yarn 2. Config nginx.conf before start nginx 3. add sudo into cleanup skyline Change-Id: Id02e135fdbe880b9b052a6b644816f3273361e2a
This commit is contained in:
parent
63db3fb835
commit
7cd4168047
@ -69,26 +69,19 @@ function _install_dependent_tools {
|
|||||||
# poetry
|
# poetry
|
||||||
contrib_pip_install poetry!=1.1.8
|
contrib_pip_install poetry!=1.1.8
|
||||||
|
|
||||||
# node
|
# nvm
|
||||||
if is_fedora; then
|
wget -P $HOME --tries=10 --retry-connrefused --waitretry=60 --no-dns-cache --no-cache https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh
|
||||||
curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -
|
bash $HOME/install.sh
|
||||||
else
|
. $HOME/.nvm/nvm.sh
|
||||||
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
|
|
||||||
fi
|
# nodejs
|
||||||
RETRY_UPDATE=True update_package_repo
|
NODE_VERSION=erbium
|
||||||
install_package nodejs
|
nvm install --lts=$NODE_VERSION
|
||||||
sudo npm install -g n
|
nvm alias default lts/$NODE_VERSION
|
||||||
sudo n stable
|
nvm use default
|
||||||
|
|
||||||
# yarn
|
# yarn
|
||||||
if is_fedora; then
|
npm install -g yarn
|
||||||
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
|
|
||||||
else
|
|
||||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
|
||||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
|
||||||
fi
|
|
||||||
RETRY_UPDATE=True update_package_repo
|
|
||||||
install_package yarn
|
|
||||||
|
|
||||||
_install_extra_tools
|
_install_extra_tools
|
||||||
}
|
}
|
||||||
@ -99,15 +92,15 @@ function _install_dependent_tools {
|
|||||||
# cleanup_skyline() - Remove residual data files, anything left over from previous
|
# cleanup_skyline() - Remove residual data files, anything left over from previous
|
||||||
# runs that a clean run would need to clean up
|
# runs that a clean run would need to clean up
|
||||||
function cleanup_skyline {
|
function cleanup_skyline {
|
||||||
rm -rf $SKYLINE_CONF_DIR
|
sudo rm -rf $SKYLINE_CONF_DIR
|
||||||
rm -rf $SKYLINE_LOG_DIR
|
sudo rm -rf $SKYLINE_LOG_DIR
|
||||||
rm -rf $SKYLINE_RUN_DIR
|
sudo rm -rf $SKYLINE_RUN_DIR
|
||||||
|
|
||||||
# remove all .venv under skyline
|
# remove all .venv under skyline
|
||||||
find $SKYLINE_DIR -name '.venv'|xargs rm -rf
|
sudo find $SKYLINE_DIR -name '.venv'|xargs rm -rf
|
||||||
|
|
||||||
# remove static
|
# remove static
|
||||||
rm -rf $SKYLINE_DIR/libs/skyline-console/skyline_console/static
|
sudo rm -rf $SKYLINE_DIR/libs/skyline-console/skyline_console/static
|
||||||
|
|
||||||
# uninstall nginx
|
# uninstall nginx
|
||||||
uninstall_package nginx
|
uninstall_package nginx
|
||||||
@ -133,11 +126,6 @@ function configure_skyline {
|
|||||||
# we can see more details from devstack/lib/keystone
|
# we can see more details from devstack/lib/keystone
|
||||||
_skyline_config_set $SKYLINE_CONF_FILE "interface_type: *.*" "interface_type: public"
|
_skyline_config_set $SKYLINE_CONF_FILE "interface_type: *.*" "interface_type: public"
|
||||||
_skyline_config_set $SKYLINE_CONF_FILE "log_dir: *.*" "log_dir: /var/log"
|
_skyline_config_set $SKYLINE_CONF_FILE "log_dir: *.*" "log_dir: /var/log"
|
||||||
|
|
||||||
# skyline-console Configuration
|
|
||||||
#-------------------------
|
|
||||||
|
|
||||||
sudo $SKYLINE_DIR/.venv/bin/nginx-generator -o /etc/nginx/nginx.conf
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# create_skyline_accounts() - Create required service accounts
|
# create_skyline_accounts() - Create required service accounts
|
||||||
@ -174,6 +162,11 @@ function start_skyline {
|
|||||||
|
|
||||||
run_process "skyline" "$SKYLINE_DIR/.venv/bin/gunicorn -c /etc/skyline/gunicorn.py skyline_apiserver.main:app"
|
run_process "skyline" "$SKYLINE_DIR/.venv/bin/gunicorn -c /etc/skyline/gunicorn.py skyline_apiserver.main:app"
|
||||||
|
|
||||||
|
# skyline-console Configuration
|
||||||
|
#-------------------------
|
||||||
|
|
||||||
|
sudo $SKYLINE_DIR/.venv/bin/nginx-generator -o /etc/nginx/nginx.conf
|
||||||
|
|
||||||
# skyline-console Start
|
# skyline-console Start
|
||||||
#-------------------------
|
#-------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user