Using 'gitrepo' to automatically set up site respository
From Metro Studios Knowledgebase
The script 'gitrepo' is used to automate the process of setting up a git respository. This should be installed on all of the web servers.
- Login to the server (web1,web2,web3,web4).
- - The appropriate server can be found under the 'FTP' section in KeePass.
- Elevate to root user (gitrepo must be ran as the root user)
- - Run 'su' and use root password for relevant webserver found under 'Server Users' in KeePass.
- Running just "gitrepo" will give you a listing of all arguments.
- Change into the virtual host's httpdocs (ex: cd /var/www/vhosts/allancustomhomes.com/httpdocs/)
- Run "gitrepo --cleanup" in order to clean up the site files before versioning.
- - This looks for possible temporary and backup files that should be removed manually.
- - These files should be backed up on local storage before removing.
- Run "gitrepo --size" and note any directories that are very large for adding to the .gitignore in the document root.
- - This is to ensure we're not bloating the size of our git repository (<10 MB).
- - If any large directories contain files that are not expected to change they should be added to the .gitignore file.
- Run "gitrepo --gitignore" to find directories that should be included in the .gitignore manually.
- Run "gitrepo --create"
- - If there is a .gitignore file already within the document root the script will use that
- - If there is no .gitignore file then the script will create one with some default settings and ask you if you wish to manually add to that.
- - If you have additional directories that were found through the "gitrepo --size" or the "gitrepo --gitignore" now is the time to add them.
- Document the site in the knowledgebase.