git-dev-workflow icon indicating copy to clipboard operation
git-dev-workflow copied to clipboard

Feature request: Add script to quickly remove a site

Open davidneedham opened this issue 12 years ago • 4 comments

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:

  1. Add a new command/script that removes all parts of a site.
  2. 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:

davidneedham avatar Oct 16 '13 16:10 davidneedham

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?

13rac1 avatar Oct 17 '13 23:10 13rac1

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?

davidneedham avatar Oct 19 '13 21:10 davidneedham

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.

13rac1 avatar Oct 21 '13 21:10 13rac1

To add to your list above, Delete the user from gitolite: cd /root/gitolite-admin/conf/ & /root/gitolite/keydir

davidneedham avatar Jan 03 '14 20:01 davidneedham