Qorus Integration Engine®  4.0.3.p2_git
Custom Release Scripts (qscripts)

Introduction to Custom Release Scripts

Custom release scripts allow Qorus developers to perform fine-tuned release tasks automatically running oload: Data Loading Tool and Schema Manager or in standard deployment packages made by make-release: Qorus Release Packager.

oload: Data Loading Tool and Schema Manager (also called internally in packages created by make-release) recognizes the qscript file extension and the script is executed in the particular place of the oload run.

Phases

PRE

File mask:

  • *-pre.qscript

Scripts are run at the beginning of the deployment. Before anything else.

POST

File mask:

  • *.qscript original, legacy qscripts
  • *-post.qscript

Scripts are run after the deployment. But before potential Qorus server obejcts reload.

POST_RELOAD

File mask:

  • *-post_reload.qscript

Scripts are run after the deployment and after potential Qorus server objects reload.

Custom Release Script Files

Custom release scripts are regular Qore language scripts with unlimited support for all features provided including user modules etc.

Every script is sandboxed into dedicated Qore Program object with Qorus option qorus.defines imported.

The biggest advantage can be availability of import of QorusClientCore module. See Client Library API Reference

Useful functions are available in Module module

Example - a script checking presence of some directory on filesystem with its creation:

#!/usr/bin/env qore
%new-style
%require-types
%strict-args
%enable-all-warnings
%requires QorusClientCore
QorusClient::init();
# defines from options are available
%ifdef ISEPL
# ensure we will create a special directory under filesystem user connection
Dir d = get_user_connection("fs-mseplftp");
d.chdir("foo");
printf("checking dir: %s\n", d.path());
if (!d.exists())
d.create();
%endif

With usage and a showcase that dir 'foo' is really created

[lister:bin pvanek] ls -l /appl/data/mseplftp/
total 0
[lister:work pvanek] oload test.qscript
Running custom script: /Users/pvanek/src/qorus/work/test.qscript
checking dir: /appl/data/mseplftp/foo
[lister:bin pvanek] ls -l /appl/data/mseplftp/
total 0
drwxr-xr-x 2 pvanek staff 68 Nov 11 22:14 foo