Automatic continuous compilation of webforms on linux/unix
Automatic continuous compilation of webforms on linux without X-terminal
In the webforms world you it is not uncommon to compile a webforms application on a linux/unix application server, after you’ve build a forms module on your Window development environment. Modules compiled on Windows typically will not run on another operating system, so the binaries must be deployed (i.e. by ftp) to the applicaiton server where they are compiled.
These tasks can be quite a burden if you imagine that every time a module is changed by a developer he/she has to ftp it to an application server, compile it and optionally copy the executable to a directory on the FORMS_PATH. Extra software must be installed on the desktop: an FTP client and optionally, X-terminal software to be able to compile the module in a grafical user interface. On the operating level the developer(s) should be known users on the application server. Finally, the developer(s) should be able to understand some unix/linux commands.
There is an easier way, however! Automatic, continous compilation. The goal is to maximize ease while minimizing the effort for both developers and administrators to deploy new/changed webforms modules to a linux based application server.This can be set up as described here.
The way we generally work at Amis is that all sources are maintained by a versioning system like CVS or subversion. The CVS or subversion client software is also installed on the application server. When a developer finishes developing on a forms module (or library module, menu module, etc), he/she checks-in the module into the versioning system.
And here ends the cycle for the developer (remember minimize ease)!
The application server picks up all changes from the version system via a shell-script scheduled in the crontab. It’s scheduled to run every 10 minutes, but the scheduling can be changed to any required value. The scheduled script is run as oracle-user because on our system the oracle-user is the only user privileged to run oracle software on the iAS. An example is show below.
#!/bin/bash<br />#<br /># Crontab job script for compilation webforms applications<br /># parameter 1: conn = Oracle connectstring (scott/tiger@orcl)<br /># parameter 2: os_user = username application owner (each application has os_user as owner)<br />#<br />. /etc/profile<br />cd /home/$os_user<br />svn update<br />/home/$os_user/bin/compile.sh $conn $os_user<br />
The compile script that is called obviously compiles all new or changed modules in batch-mode using frmcmp_batch.sh. Then, finally the executables are moved to the FORMS_PATH path. The FORMS_PATH is set in the proper environment file on $MIDTIER_HOME/forms/server.
Using frmcmp_batch.sh over frmcmp.sh is crucial if you want to ommit X-terminal. By using crontab we are unable to use X-terminal applications.
An excerpt of the compile script is shown below.
#!/bin/bash<br />#<br /># Compile recent (< 10 minuten) changes in application<br />#<br />echo Set Oracle environment<br />export FORMS_PATH=$PAGONI_HOME/build:$FORMS_PATH<br />export ORACLE_SID=midtier<br />export ORAENV_ASK=NO<br />. oraenv<br /><br />export TERM=vt220<br />export ORACLE_TERM=$TERM<br />export NLS_LANG=AMERICAN_AMERICA.UTF8<br /><br /># copy sources to build directory (code left out)<br /><br />echo Compilation OFG-library modules ...<br />for i in `find $PAGONI_HOME/build/ofg*.pll -mmin -10`<br />do<br /> echo Compiling Library $i ....<br /> $ORACLE_HOME/bin/frmcmp_batch.sh userid=$conn module=$i module_type=LIBRARY compile_all=yes window_state=minimize<br />done<br /><br /># repeat for other module types (code left out)<br /># move executables to FORMS_PATH in environment file in $MIDTIER_HOME/forms/server. (code left out)<br />echo Finished.<br />exit 0<br />
The important pieces are to get it all working are setting ORACLE_TERM, NLS_LANG and FORMS_PATH and use frmcmp_batch.sh over frmcmp.sh. Further,
- On the application server no developer-user accounts are present.
- No other user-accounts than oracle needed to compile webforms application.
- Developers don’t have to install extra software (FTP-client, putty, X-terminal).
- Developers don’t have to learn linux/unix shell commands.
- Compilation is perfdormed automatically, via the cronjob.
- Compilation is done without the need of an X-terminal.
- Mandatory software on both developers desktop and on application server: versioning software (subversion or CVS).