Example 4-35 Contents of python_deploy directory

itsouser@ubuntu:~/python_deploy$ ls

-Rl

.:

 

 

 

total 16

 

 

 

drwxr-xr-x

2

itsouser itsouser 4096

2008-06-28 17:52 bin

drwxr-xr-x

2

itsouser itsouser 4096

2008-06-28 21:29 egg

drwxr-xr-x

2

itsouser itsouser 4096

2008-06-28 17:52 odbcdrv

-rwxr-xr-x

1

itsouser itsouser 2978

2008-06-28 11:25 py_app_install

./bin:

 

 

 

total 4

 

 

 

-rw-r--r--

1

itsouser itsouser 1164

2008-06-28 17:52 itso_pyapp.py

./egg:

 

 

 

total 716

 

 

 

-rw-rw-r--

1

itsouser itsouser 400192 2008-06-28 21:29

ibm_db-0.2.9-py2.5-linux-x86_64.egg

 

-rw-r--r--

1

itsouser itsouser 322831 2008-06-28 17:52 setuptools-0.6c7-py2.5.egg

./odbcdrv:

 

 

 

total 7564

 

 

 

-rw-rw-r--

1

itsouser itsouser 7730644 2008-06-28 17:52 itso_cli.tar.gz

 

 

 

 

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

Example 4-36 Package generation for python_deploy

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

../py_app_installer.tar.gz bin/ bin/itso_pyapp.py

egg/

egg/ibm_db-0.2.9-py2.5-linux-x86_64.egg egg/setuptools-0.6c7-py2.5.egg odbcdrv/

odbcdrv/itso_cli.tar.gz py_app_install

Deploying the sample Python application

The deployment process for the DB2 Python 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-37for the steps involved in DB2 Python application deployment.

Chapter 4. Deploying applications with DB2 197

Page 211
Image 211
IBM DB2 manual Deploying the sample Python application, Example 4-35 Contents of pythondeploy directory