Browse Source

fix: obter ip, criar a pasta staticfiles

main
Lucas 2 years ago
parent
commit
2ca3e8c7a1
  1. 12
      run.sh

12
run.sh

@ -167,11 +167,7 @@ fi
# Obtém o IP
# Get IP address
if [[ ! -n $PUB_IP ]]; then
if [[ -n $(man hostname | awk '{RS="";FS="\n"} /-i,/ {print}') ]]; then
PUB_IP=$(hostname -i | cut -d" " -f1)
else
PUB_IP=$(hostname -I | cut -d" " -f1)
fi
fi
update_step_error() {
@ -286,6 +282,7 @@ update_debug() {
# Instala pacotes necessários
# Install required packages
install_packages() {
dnf update &&
yum -y install vim &&
yum -y install epel-release &&
yum -y install bind-utils &&
@ -296,7 +293,6 @@ install_packages() {
yum -y install nginx &&
yum -y install net-tools &&
yum -y install policycoreutils-python-utils.noarch &&
dnf update
if [[ $? -ge 1 ]]; then
update_step_error "$x"
fi
@ -325,12 +321,9 @@ install_dependencies() {
# Coletar arquivos estáticos, criar tabelas e criar super usuário
# Perform collectstatic, migrate and createsuperuser
execute_collec_mig_createsup() {
if [[ -d /home/$USERNAME/$APP/staticfiles ]]; then
mkdir -p /home/$USERNAME/$APP/staticfiles
fi
mkdir -p /home/$USERNAME/$APP/staticfiles &&
/home/$USERNAME/$APP/$VENV/bin/python3 /manage.py collectstatic --noinput &&
/home/$USERNAME/$APP/$VENV/bin/python3 /manage.py migrate &&
/home/$USERNAME/$APP/$VENV/bin/python3 /manage.py createsuperuser
}
# Instala o firewall
@ -547,6 +540,7 @@ declare -a commands=(
"install_packages"
"create_venv"
"install_dependencies"
"execute_collec_mig_createsup",
"install_firewall"
"enable_ports"
"manage_default_nginx_file"

Loading…
Cancel
Save