We placed the deployment script under our deployment directory /ruby_deploy. Example 4-28shows the contents of the ruby_deploy directory, which now has all the files for deployment.

Example 4-28 Contents of ruby_deployment directory

itsouser@ubuntu:~/ruby_deploy$ ls -Rl

.: total 16

drwxrwxr-x 2 itsouser itsouser 4096 2008-06-27 20:41 bin drwxrwxr-x 2 itsouser itsouser 4096 2008-06-27 20:41 gem drwxrwxr-x 2 itsouser itsouser 4096 2008-06-27 20:41 odbcdrv

-rwxr-xr-x 1 itsouser itsouser 2972 2008-06-27 20:41 ruby_app_install

./bin: total 4

-rw-r--r-- 1 itsouser itsouser 1055 2008-06-27 20:41 itso_rubyapp.rb

./gem: total 288

-r--r--r-- 1 itsouser itsouser 289792 2008-06-27 20:41 ibm_db-0.9.0.gem

./odbcdrv: total 7564

-rw-rw-r-- 1 itsouser itsouser 7730644 2008-06-27 20:41 itso_cli.tar.gz

We can simply compress and archive the entire directory for distribution to other systems. See Example 4-29.

Example 4-29 Package generation for ruby_deploy

itsouser@ubuntu:~/ruby_deploy$ tar -cvf - *gzip -c >

../ruby_app_installer.tar.gz bin/ bin/itso_rubyapp.rb

gem/

gem/ibm_db-0.9.0.gem odbcdrv/ odbcdrv/itso_cli.tar.gz ruby_app_install

Deploying the DB2 Ruby application

The deployment process for the DB2 ruby application involves transfer of the deployment package to the target system, uncompressing/extracting files in the package and then executing the deployment script. See Example 4-30.

Chapter 4. Deploying applications with DB2 187

Page 201
Image 201
IBM manual Deploying the DB2 Ruby application, Example 4-28 Contents of rubydeployment directory