update
This commit is contained in:
parent
59267d413f
commit
bc9e58aea9
@ -17,7 +17,9 @@ mvn -version
|
|||||||
|
|
||||||
echo "=== Installation de Tomcat 10 ==="
|
echo "=== Installation de Tomcat 10 ==="
|
||||||
cd /opt
|
cd /opt
|
||||||
sudo wget https://dlcdn.apache.org/tomcat/tomcat-10/v10.1.47/bin/apache-tomcat-10.1.47.tar.gz
|
#sudo wget https://dlcdn.apache.org/tomcat/tomcat-10/v10.1.47/bin/apache-tomcat-10.1.47.tar.gz
|
||||||
|
sudo wget https://archive.apache.org/dist/tomcat/tomcat-10/v10.1.47/bin/apache-tomcat-10.1.47.tar.gz
|
||||||
|
|
||||||
sudo tar -xvzf apache-tomcat-10.1.47.tar.gz
|
sudo tar -xvzf apache-tomcat-10.1.47.tar.gz
|
||||||
sudo mv apache-tomcat-10.1.47 tomcat
|
sudo mv apache-tomcat-10.1.47 tomcat
|
||||||
sudo chown -R vagrant:vagrant /opt/tomcat
|
sudo chown -R vagrant:vagrant /opt/tomcat
|
||||||
@ -70,6 +72,8 @@ DROP DATABASE IF EXISTS archiweb_db;
|
|||||||
CREATE DATABASE archiweb_db;
|
CREATE DATABASE archiweb_db;
|
||||||
CREATE USER archiweb_user WITH ENCRYPTED PASSWORD 'archiweb_pass';
|
CREATE USER archiweb_user WITH ENCRYPTED PASSWORD 'archiweb_pass';
|
||||||
GRANT ALL PRIVILEGES ON DATABASE archiweb_db TO archiweb_user;
|
GRANT ALL PRIVILEGES ON DATABASE archiweb_db TO archiweb_user;
|
||||||
|
\c archiweb_db
|
||||||
|
GRANT ALL ON SCHEMA public TO archiweb_user;
|
||||||
\q
|
\q
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@ -80,7 +84,27 @@ sudo systemctl restart postgresql
|
|||||||
sudo systemctl status postgresql --no-pager
|
sudo systemctl status postgresql --no-pager
|
||||||
|
|
||||||
echo "=== Import des schémas et données ==="
|
echo "=== Import des schémas et données ==="
|
||||||
sudo -u archiweb_user psql -U archiweb_user -d archiweb_db -f /vagrant/database/schema.sql -W <<< "archiweb_pass"
|
# Attendre que PostgreSQL soit complètement redémarré
|
||||||
sudo -u archiweb_user psql -U archiweb_user -d archiweb_db -f /vagrant/database/data.sql -W <<< "archiweb_pass"
|
sleep 3
|
||||||
|
|
||||||
echo "=== Installation et déploiement terminé ==="
|
# Import avec PGPASSWORD et vérification des fichiers
|
||||||
|
if [ -f /vagrant/database/schema.sql ]; then
|
||||||
|
echo "Import du schéma..."
|
||||||
|
PGPASSWORD=archiweb_pass psql -h localhost -U archiweb_user -d archiweb_db -f /vagrant/database/schema.sql
|
||||||
|
else
|
||||||
|
echo "ERREUR: Fichier schema.sql introuvable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /vagrant/database/data.sql ]; then
|
||||||
|
echo "Import des données..."
|
||||||
|
PGPASSWORD=archiweb_pass psql -h localhost -U archiweb_user -d archiweb_db -f /vagrant/database/data.sql
|
||||||
|
else
|
||||||
|
echo "ERREUR: Fichier data.sql introuvable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== Vérification de l'import ==="
|
||||||
|
PGPASSWORD=archiweb_pass psql -h localhost -U archiweb_user -d archiweb_db -c "\dt"
|
||||||
|
|
||||||
|
echo "=== Installation et déploiement terminé ==="
|
||||||
Loading…
x
Reference in New Issue
Block a user