Skip to content

Commit

Permalink
remove old code from after_install
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlanglen committed Apr 30, 2024
1 parent fea902f commit 3d2fbc0
Showing 1 changed file with 5 additions and 26 deletions.
31 changes: 5 additions & 26 deletions scripts/after_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,10 @@
# Log output to a specific file
LOG_FILE="/home/ec2-user/django-indexer/logs/deploy.log"

echo 'Running after_install.sh' >> "$LOG_FILE"

# # Log the current date and time in a human-readable format
# echo "Script execution started at: $(date '+%Y-%m-%d %H:%M:%S')" >> "$LOG_FILE"

# # Set correct ownership recursively for all files and directories in the project directory
# sudo chown -R ec2-user:ec2-user /home/ec2-user/django-indexer/
# echo "$(date) - Changed ownership to ec2-user for all project files" >> "$LOG_FILE"

# # Set read, write, and execute permissions for the owner and group, and read and execute for others
# sudo chmod -R 775 /home/ec2-user/django-indexer/
# echo "$(date) - Set permissions to 775 for all project files" >> "$LOG_FILE"

# # Set the group of the Django project and static files to nginx
# sudo chown -R ec2-user:nginx /home/ec2-user/django-indexer

# # Set the group of the socket directory to nginx
# sudo chown -R ec2-user:nginx /home/ec2-user/django-indexer/run

# # Restart the nginx service to propagate the changes
# sudo systemctl restart nginx
echo -e "\n\n" >> "$LOG_FILE"
echo "=========================================" >> "$LOG_FILE"
echo "Running after_install.sh at $(date '+%Y-%m-%d %H:%M:%S')" >> "$LOG_FILE"
echo "=========================================" >> "$LOG_FILE"

# Set correct ownership recursively for project directory
sudo chown -R ec2-user:nginx /home/ec2-user/django-indexer/
Expand Down Expand Up @@ -66,8 +49,4 @@ else
sudo systemctl restart gunicorn celery
fi

# # Log the results of permissions change
# echo "Permissions after update:" >> "$LOG_FILE"
# ls -lah /home/ec2-user/django-indexer/ >> "$LOG_FILE"

echo 'after_install.sh completed' >> "$LOG_FILE"
echo "$(date '+%Y-%m-%d %H:%M:%S') - after_install.sh completed" >> "$LOG_FILE"

0 comments on commit 3d2fbc0

Please sign in to comment.