Add info messages to run.sh

Signed-off-by: Andrei Boyanov <andrei.boyanov@gmail.com>
This commit is contained in:
Andrei Boyanov 2025-04-19 12:05:36 +02:00 committed by GitHub
parent bfab5851d7
commit feb3c5011e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

12
run.sh
View File

@ -4,13 +4,16 @@ PORT=$2
CHAT=$3
# Clone Odoo directory
echo "Clonning the repository"
git clone --depth=1 https://github.com/andreiboyanov/emf-1995-docker-compose $DESTINATION
rm -rf $DESTINATION/.git
# Create PostgreSQL directory
echo "Creating the poostgresql folder $DESTINATION/postgresql"
mkdir -p $DESTINATION/postgresql
# Change ownership to current user and set restrictive permissions for security
echo "Configuring permissions"
sudo chown -R $USER:$USER $DESTINATION
sudo chmod -R 700 $DESTINATION # Only the user has access
@ -19,6 +22,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Running on macOS. Skipping inotify configuration."
else
# System configuration
echo "Configuring sysctl.conf"
if grep -qF "fs.inotify.max_user_watches" /etc/sysctl.conf; then
echo $(grep -F "fs.inotify.max_user_watches" /etc/sysctl.conf)
else
@ -35,17 +39,19 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/20018/'$CHAT'/g' $DESTINATION/docker-compose.yml
else
# Linux sed syntax
echo "Configuring the Odoo ports"
sed -i 's/10018/'$PORT'/g' $DESTINATION/docker-compose.yml
sed -i 's/20018/'$CHAT'/g' $DESTINATION/docker-compose.yml
fi
# Set file and directory permissions after installation
echo "Configuring $DESTINATION permissions"
find $DESTINATION -type f -exec chmod 644 {} \;
find $DESTINATION -type d -exec chmod 755 {} \;
echo "Making the entrypoint executable"
chmod +x $DESTINATION/entrypoint.sh
# Run Odoo
docker compose -f $DESTINATION/docker-compose.yml up -d
echo "Odoo started at http://localhost:$PORT | Master Password: minhng.info | Live chat port: $CHAT"
"Running the EMF-1995 social app"
docker compose -f $DESTINATION/docker-compose.yml up -d && echo "Odoo started at http://localhost:$PORT | Master Password: minhng.info | Live chat port: $CHAT"