Feature request: Add script to quickly remove a site
Creating a site is simple and fast. But what if I made a typo in the name? Or what if GDW is on a development server that regularly needs to wipe out sites that have launched and are no longer needed?
Suggestions:
- Add a new command/script that removes all parts of a site.
- Provide instructions in the readme that describes all locations that need to be deleted or changed to get rid of a site.
I'd obviously prefer 1, but even 2 would be better than nothing. :+1:
The Ansible scripts are thoroughly documented which should make #2 simple.
Here is a start to #2:
- Disable the site's Apache Virtualhosts in /etc/apache2/sites-enabled/
- Delete the site's Apache Virtualhosts in /etc/apache2/sites-available/
- Restart/Reload Apache: sudo service apache2 restart
- Delete the site's databases: mysql -e 'drop database project_dev;drop database project_test;drop database project_live;'
- Delete the site's code: rm -rf /var/www/project
- Remove the project user: userdel project
- Remove the project user's home: rm -rf /home/project
- Delete the repo from gitolite: cd /root/gitolite-admin/conf/repositories/
- Commit the changes to gitolite.
- Delete the actual repo files from: /var/git/repositories/
That's probably it. Anything else?
That makes sense. Still, it'd be nice if there was a script to do it for me. Would this be easy enough for me to do myself, or is it harder than it sounds?
It shouldn't be too difficult. I haven't been removing projects from my systems, so haven't needed a removal script. I plan to make a script, but it won 't be soon.
If you make something for removal, please make it in Ansible and give me a pull request.
To add to your list above, Delete the user from gitolite: cd /root/gitolite-admin/conf/ & /root/gitolite/keydir