ManageAllAdminScriptsWithSVN: Difference between revisions
m (Created page with " === Goal ===
We (grid sysadmins) are using a lot of scripts to accomplish a lot of different tasks. The main problem with these scripts is that they are disseminated on seve...") |
No edit summary |
||
Line 2: | Line 2: | ||
=== Goal === | === Goal === | ||
We (grid sysadmins) are using a lot of scripts to accomplish a lot of different tasks. The main problem with these scripts is that they are disseminated on several servers. To ease their maintenance, we then decided to manage them from a single SVN repository located on our documentation server (mon). | We (grid sysadmins) are using a lot of scripts to accomplish a lot of different tasks. The main problem with these scripts is that they are disseminated on several servers. To ease their maintenance, we then decided to manage them from a single SVN repository located on our documentation server (mon). | ||
=== List of Scripts === | |||
We maintain a list of all the scripts that are used, their place and their eventual cron execution [[ListOfScripts here]] | |||
=== Accessing the repo === | === Accessing the repo === |
Revision as of 09:26, 15 September 2015
Goal
We (grid sysadmins) are using a lot of scripts to accomplish a lot of different tasks. The main problem with these scripts is that they are disseminated on several servers. To ease their maintenance, we then decided to manage them from a single SVN repository located on our documentation server (mon).
List of Scripts
We maintain a list of all the scripts that are used, their place and their eventual cron execution ListOfScripts here
Accessing the repo
You need a valid account (see next section for the creation of accounts). Here is the URL of the repo :
http://mon.iihe.ac.be/repos/scripting
Having a quicky look at the content of the repo, you'll see that, under the root, we have created one directory per server.
Creation of a new account
Log in on mon. Edit the file /var/svn/repos/scripting/svnauth. Here is an example :
[/] stgerard = rw mdupont = rw
Now, you have to generate the encrypted password for the new created account :
htpasswd -m /var/svn/repos/scripting/svnpass mdupont
How to copy a new script/project to the central SVN ?
Say that, for example, you've just created a new project, locate in /root/myproject on ccq. Here are the steps to add this new project to the central SVN :
cd /root svn import -m "new project found in ccq --> myproject" myproject http://mon.iihe.ac.be/repos/scripting/ccq/myproject cd myproject svn checkout --force http://mon.iihe.ac.be/repos/scripting/ccq/myproject .
However, if you want to exclude files from the project (temporary, examples, log files, etc.), then, don't use svn import. Instead, do the following :
svn mkdir http://mon.iihe.ac.be/repos/scripting/ccq/myproject -m "creating a new project" svn checkout --force http://mon.iihe.ac.be/repos/scripting/ccq/myproject cd myproject svn checkout http://mon.iihe.ac.be/repos/scripting/ccq/myproject . svn add <the list of files you want to add, seperated by spaces> svn commit -m "initial version of myproject"
What if you intend to modify the local copy of a project ?
First of all, before modifying the files, never forget to make an update of the local copy :
cd myproject svn update
After having modified the files, commit the changes :
svn commit -m "initial version of myproject"
If you have added new files, don't forget to add them :
svn add <the list of files you want to add, seperated by spaces>