fix: obter ip, criar a pasta staticfiles
This commit is contained in:
parent
632ce923ef
commit
2ca3e8c7a1
1 changed files with 6 additions and 12 deletions
14
run.sh
14
run.sh
|
|
@ -167,11 +167,7 @@ fi
|
||||||
# Obtém o IP
|
# Obtém o IP
|
||||||
# Get IP address
|
# Get IP address
|
||||||
if [[ ! -n $PUB_IP ]]; then
|
if [[ ! -n $PUB_IP ]]; then
|
||||||
if [[ -n $(man hostname | awk '{RS="";FS="\n"} /-i,/ {print}') ]]; then
|
PUB_IP=$(hostname -I | cut -d" " -f1)
|
||||||
PUB_IP=$(hostname -i | cut -d" " -f1)
|
|
||||||
else
|
|
||||||
PUB_IP=$(hostname -I | cut -d" " -f1)
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
update_step_error() {
|
update_step_error() {
|
||||||
|
|
@ -286,6 +282,7 @@ update_debug() {
|
||||||
# Instala pacotes necessários
|
# Instala pacotes necessários
|
||||||
# Install required packages
|
# Install required packages
|
||||||
install_packages() {
|
install_packages() {
|
||||||
|
dnf update &&
|
||||||
yum -y install vim &&
|
yum -y install vim &&
|
||||||
yum -y install epel-release &&
|
yum -y install epel-release &&
|
||||||
yum -y install bind-utils &&
|
yum -y install bind-utils &&
|
||||||
|
|
@ -296,7 +293,6 @@ install_packages() {
|
||||||
yum -y install nginx &&
|
yum -y install nginx &&
|
||||||
yum -y install net-tools &&
|
yum -y install net-tools &&
|
||||||
yum -y install policycoreutils-python-utils.noarch &&
|
yum -y install policycoreutils-python-utils.noarch &&
|
||||||
dnf update
|
|
||||||
if [[ $? -ge 1 ]]; then
|
if [[ $? -ge 1 ]]; then
|
||||||
update_step_error "$x"
|
update_step_error "$x"
|
||||||
fi
|
fi
|
||||||
|
|
@ -325,12 +321,9 @@ install_dependencies() {
|
||||||
# Coletar arquivos estáticos, criar tabelas e criar super usuário
|
# Coletar arquivos estáticos, criar tabelas e criar super usuário
|
||||||
# Perform collectstatic, migrate and createsuperuser
|
# Perform collectstatic, migrate and createsuperuser
|
||||||
execute_collec_mig_createsup() {
|
execute_collec_mig_createsup() {
|
||||||
if [[ -d /home/$USERNAME/$APP/staticfiles ]]; then
|
mkdir -p /home/$USERNAME/$APP/staticfiles &&
|
||||||
mkdir -p /home/$USERNAME/$APP/staticfiles
|
|
||||||
fi
|
|
||||||
/home/$USERNAME/$APP/$VENV/bin/python3 /manage.py collectstatic --noinput &&
|
/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 migrate &&
|
||||||
/home/$USERNAME/$APP/$VENV/bin/python3 /manage.py createsuperuser
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Instala o firewall
|
# Instala o firewall
|
||||||
|
|
@ -547,6 +540,7 @@ declare -a commands=(
|
||||||
"install_packages"
|
"install_packages"
|
||||||
"create_venv"
|
"create_venv"
|
||||||
"install_dependencies"
|
"install_dependencies"
|
||||||
|
"execute_collec_mig_createsup",
|
||||||
"install_firewall"
|
"install_firewall"
|
||||||
"enable_ports"
|
"enable_ports"
|
||||||
"manage_default_nginx_file"
|
"manage_default_nginx_file"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue