build.bat to the rescue

For almost three years now I’ve been manually building Real Estate Script (and Instant Update while it was closed-source) for release, which means for each version I had to do this:

  • 1. put old version in one folder
  • 2. compare old with development version and extract only modified files
  • 3. merge the two versions into a new version, in separate folder
  • 4. encode new version with ionCube into separate folder
  • 5. copy certain encoded files over new version
  • 6. pack the new version files into a ZIP archive for distribution

 

…and I’ve been doing that for each license type, every time we were publishing a new version of the script, so I had to repeat last two steps five times for branded (white label) version, regular version, free-trial version, branded (white label) upgrade and regular version upgrade, to get five different ZIP files for distribution. Free trials do not have upgrade package as they work only 30 days.

And this was not a problem. After couple of versions I got into the routine so I could do all of this for about three hours (for all five versions), while step #2 was taking most of the time (about 30-45) minutes. But the real problems appeared when after building all ZIPs I realized we had a bug in the code, so I had to update all five ZIPs manually. There were misplaced files everywhere, updating 3 or 4 out of 5 archives, then forgetting to update source folders (from which I initially created ZIP files), and so on…

It all got worse after PHP 5.3 (and 5.4) was getting installed on more and more servers, because strangely, ionCube uses different encoding algorithm and thus requires different (encoded) files for PHP versions up to 5.3 and for versions 5.3 and above. So, over night, number of ZIP files to manage jumped from five to ten!

Today I spent about three hours writing a batch command script named simply build.bat, which does everything explained above automatically, producing ten ZIP files ready for distribution. All I need to do is to provide old version of the software in folder named “old”, and modified files in folder named “diff”, run the build.bat, enter couple of parameters and it will spit out ten ZIP files in less than three minutes. Three minutes for full merge/encode/build for all 10 ZIP files instead of three hours (180 minutes), that seems to me like a 60x speed increase/time saving! And chance for errors is minimal! And even if error happens, I can fix it and re-build everything again in three minutes!

Here are couple of screenshots:

Intro/menu screen

Building, building...

Bulding ZIPs

And a log output:

[sun 16.11.2014 @ 18:13:57,89] Started building real-estate-script 2.2 
[sun 16.11.2014 @ 18:14:07,03] Cleaned build directory 
[sun 16.11.2014 @ 18:14:27,91] Merged old and diff versions 
[sun 16.11.2014 @ 18:14:29,83] Copied upgrade version to build directory 
[sun 16.11.2014 @ 18:14:53,10] Encoded project for PHP 5.2 
[sun 16.11.2014 @ 18:15:12,90] Encoded project for PHP 5.3+ 
[sun 16.11.2014 @ 18:15:13,17] Copied skel files 
[sun 16.11.2014 @ 18:15:27,22] Created real-estate-script-2.2-branded-php-5.2.zip 
[sun 16.11.2014 @ 18:15:41,65] Created real-estate-script-2.2-branded-php-5.3.zip 
[sun 16.11.2014 @ 18:15:55,97] Created real-estate-script-2.2-php-5.2.zip 
[sun 16.11.2014 @ 18:16:10,58] Created real-estate-script-2.2-php-5.3.zip 
[sun 16.11.2014 @ 18:16:27,15] Created real-estate-script-2.2-free-trial-php-5.2.zip 
[sun 16.11.2014 @ 18:16:43,70] Created real-estate-script-2.2-free-trial-php-5.3.zip 
[sun 16.11.2014 @ 18:16:45,50] Created real-estate-script-2.2-branded-upgrade-php-5.2.zip 
[sun 16.11.2014 @ 18:16:47,11] Created real-estate-script-2.2-branded-upgrade-php-5.3.zip 
[sun 16.11.2014 @ 18:16:48,74] Created real-estate-script-2.2-upgrade-php-5.2.zip 
[sun 16.11.2014 @ 18:16:50,56] Created real-estate-script-2.2-upgrade-php-5.3.zip 
[sun 16.11.2014 @ 18:16:50,57] Finished building real-estate-script 2.2

I think this is awesome and in future we’ll be releasing new versions more frequently than before! Yay!

Leave a Reply

Your email address will not be published. Required fields are marked *