Saturday 29 October 2011

Automating the build and release procedure

In the past I have been frustrated at the amount of time it takes for me to create a build, due to manual tasks that needed to be performed. I have finally taken a step towards an automated build process by creating a series of .bat and .sh scripts for Windows and Linux that perform the boring work for me.

There are a number of scripts, each performing different 'stages' of the build. e.g. on Windows there is build.bat, binaries.bat and release.bat.

Build: Creates the .exe from the Python source and includes all distributable resources etc that are needed into a folder.

Binaries: First, it asks for a version number. It then modifies the program's meta script that defines the version number to ensure it's correctly set.
It then calls the build script above, and then creates an installer file by launching InnoSetup as a GUI-less program. It then creates .zip files for the stand-alone exe and moves the files to a directory ready for release.

Release: It updates the file that is used by the program to look up the latest version number when doing an update check. It then FTPs this to the server.


I've added the option for Pylint to be run against all the program's codebase and output to a file; I'm figuring out how to get my unit tests running from the command line too. I'm looking into whether I can release the binaries to the several sites where I host the program via a REST API or over FTP. This would be a huge improvement.

All in all, this will help me deploy changes much quicker when releasing.