A Better Automation Script for Siebel Development Team Tasks

Previously posted on the Siebel Hub at http://www.siebelhub.com/main/2015/01/guest-post-better-automation-script-siebel-development-team-tasks.html

We are delighted to welcome Jon Higgs of Bloomspire for a series of guest posts on various subjects ranging from automation scripts to Siebel Server errors and more.  You can find out Jon’s details at the bottom of the page and of course find out more about Bloomspire on their website.

Many of you use nightly automation routines on your projects that do things like compile the SRF, export the repository and re-generate browser scripts.  All good things.  We are big fans of automating processes where possible and also leverage a script to automate these common tasks for our project teams.

On a recent project, we’ve spent some time enhancing the .bat script that we normally use.  We got tired of updating the script directly every time we moved to a new environment and wanted to incorporate ways that we could easily detect recent changes that had taken place in the environment.  We also wanted the script to send an email to the development team so that they knew if the script was successful and attach reports that detail what had recently changed.

To accomplish this, we re-wrote the .bat script in PowerShell and leveraged PowerShell’s enhanced abilities to make several key enhancements.  Now our automation script executes these steps:

Reads input parameters from a configuration file

  1. Exports the repository
  2. Full compiles the SRF
  3. Shuts down the Siebel Server
  4. Renames the existing SRF
  5. Copies the newly compiled SRF
  6. Backs up siebns.dat
  7. Generates browser scripts
  8. Starts the Siebel Server
  9. Queries the file system to retrieve a list of files that have changed as of a given date within a specific directory.  Saves the results to a file.
  10. Queries the DB to retrieve a list of changes to key repository and non-repository tables.  Saves the results to a file.
  11. Emails a success/failure message to one or more email addresses and includes database and file system query output as attachments

The success email sent will look like this:

The script seems to run more reliably in PowerShell and because the language is more powerful, we feel that it will be easier to extend the script to do more.  Initially, we thought that sending a regular email to the team would be bothersome but we actually found it more helpful.  We found that developers appreciate the ability to review the attachments to see what has recently changed.  This has been an effective tool in making sure objects have not changed after code freeze, helping to review what developers are working on during development team meetings and even in helping to fill in details of documentation that is provided to customers.

You will find the script, configuration file and the SQL that we used to detect changes to repository and non-repository tables in a link at the bottom of this article.  In order for you to get it setup on your server, we recommend doing the following:

The Zip file with the scripts is available to subscribers. We hope members of the Siebel Hub Community find them useful.

Kind Regards