Wednesday, 24 August 2011

Continuous intigration best practice.

Continuous integration is a hot topic now a days and is one of the best new tools for the software industry in resent years.

With that I would like to share some of my continuous integration best practices that I employ with in my development environment.
  • Don't keep all the build code in one build file. Specially true when using ant. Ant is very powerful but can be very hard to debug when every thing is a one big file. Split it into multiple files.
  • Keep every thing under source control.
  • Keep one job doing one thing. It is better to have multiple jobs then one big job. This shortens the feed back cycle to the developer as they don't have to wait for a long job to finish or a very heavy processor job to know the compiler failed to compile the code due to a semicolon (;)
  • Build the binary once and then fingerprint and reuse. This will help you in identifying where the files are being used in what jobs and you can then tie them together if needed.
  • Tag every successful build with in the source control. This will enable you to get the latest good build for release.
  • Automate everything. Not to say people aren't great they are just "unexpected" feature prone.
  • Make sure the continuous integration server has a notification mechanism such as lava lamp, extrema feedback panel or email.
  • If your business process allows automate release cycle.
Hope this will help some one with their continuous integration and release the awesome power of this tool.

Friday, 29 July 2011

Learning to be a software developer.

Most people think that if one knows the coding ,if,while,switch, excreta and difference between public and private that makes one a software developer.

Well I disagree, limiting one to that knowledge makes one a coder. I spend allot of time in theories and supporting tools then in actual code.

Don't get me wrong knowing how to code is important but theory of OOP (object orientated programming) or FP (functional programming) is even more important.

Here is my list of things one should aspire to learn to be come a great software developer.
  1. Learn about build / project tools like Ant, Maven and many others this will enable you to help your team to accomplice automation when delivering good quality software.
  2. Learn about support tools like findbugs, code coverage tools, pmd this will help you to write good code and maintain standards.
  3. Learn about continuous integration tools like hudson, jenkins.
  4. Learn about design patterns good source is http://sourcemaking.com/ this will help you in making good source code and API.
  5. Learn about refactoring same source http://sourcemaking.com/
  6. Learn about source control cvs, svn, git
  7. Lean about agile (xp programming, scrum)
  8. Learn about project management, release and deployment. Just because you don't necessarily do it knowing how is a great asset.
The above will make you a great software developer and will be a great asset for you when entering the software developer / engineering market.

Thursday, 25 February 2010

Configuring CVS pserver on opensuse or SLE.

I am posting the how to configure the pserver for opensuse or SLE *nix installations so I can find it again with out trawling through many different sites that have very general information about this but also hopefully help someone else with the same problem.

1. Install CVS using yast.

2. Open up a terminal and login as root.

3. vi /etc/xinet.d/cvs

4. Change disable = yes to no

5. Make sure the 'server_args' attribute is pointing to your cvs repository i.e 'server_args = -f --allow-root=/usr/local/cvsroot pserver'

Now start/restart the xinet.d with either rcxinet start / rcxinet restart.

This will now enable your pserver to work and you can see it running by looking at your /var/log/message you should see something like

Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/chargen [file=/etc/xinetd.conf] [line=26]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/chargen-udp [file=/etc/xinetd.d/chargen-udp] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/cups-lpd [file=/etc/xinetd.d/cups-lpd] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/cvs [file=/etc/xinetd.d/cvs] [line=11]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/daytime [file=/etc/xinetd.d/daytime] [line=16]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/daytime-udp [file=/etc/xinetd.d/daytime-udp] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/discard [file=/etc/xinetd.d/discard] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/discard-udp [file=/etc/xinetd.d/discard-udp] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/echo [file=/etc/xinetd.d/echo] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/echo-udp [file=/etc/xinetd.d/echo-udp] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/netstat [file=/etc/xinetd.d/netstat] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/rsync [file=/etc/xinetd.d/rsync] [line=16]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/sane-port [file=/etc/xinetd.d/sane-port] [line=12]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/servers [file=/etc/xinetd.d/servers] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/services [file=/etc/xinetd.d/services] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/systat [file=/etc/xinetd.d/systat] [line=14]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinetd.d/time] [line=17]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/time-udp [file=/etc/xinetd.d/time-udp] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: Reading included configuration file: /etc/xinetd.d/vnc [file=/etc/xinetd.d/vnc] [line=15]
Mar 1 17:43:18 022656 xinetd[24151]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Mar 1 17:43:18 022656 xinetd[24151]: Started working: 1 available service

Next to consider is authentication. There are two options for this and that is either system authentication and that will be users on the box you are using or cvs's own passwd file authentication.

If you would like to use the system authentication then just add systemAuth = yes into your /etc/xinet.d/cvs file as we did above and login to the cvs server using cvs -d :pserver:username@host:/cvsroot login.

If you would like to use the passwd option then we need to make sure some requirements are availible.

1. Perl is installed on your system if not install it with yast
2. A user that has access to manipulate the cvs repository (from here on will be called cvs)
3. Logged in as root

Next navigation to your CVSROOT and create a new file named passwd and crypt.pl with 'touch' command.

Next make sure you have perl installed on your system and copy the crypt.pl code from this site (thank you Marty Phelan.) and store in your crypt.pl file. Make the file executeable with 'chmod +x crypt.pl'.

Next run the crypt.pl file with 'perl crypt.pl ' change to the password you want. This will encrypt your password to be used with in passwd file.

Copy the out put of the encryption and open the passwd file i.e vi passwd.

In the passwd file you determain the username password and the user that can access and alter cvs repository i.e
einarhreindal:asd032kasdf2:cvs this translates into username:password:user that can acces and alter cvs repository.

Save the file and check you can login to the pserver with cvs -d :pserver:username@host:/cvsroot login if you have any problems with login in then check the /var/log/message for any debug info.

Great site on how to create a repository can be found here.