Qorus Integration Engine® Enterprise Edition 6.0.15_prod
Loading...
Searching...
No Matches
Custom Release Scripts (qscripts)

Back to the Developer's Guide Table of Contents

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, nefore anything else.

POST

File mask:

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

Scripts are run after the deployment but before potential Qorus server objects are reloaded.

POST_RELOAD

File mask:

  • *-post_reload.qscript

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

Custom Release Script Files

Custom release scripts are regular scripts in any supported scripting language on the server platorm (i.e. shell, Qore, python, etc). Qore and Python scripts have the added advantage of being able to use the Qorus client API as well.

Qore scripts are sandboxed into dedicated Qore Program objects with Qorus option qorus.defines imported.

See Client Library API Reference

Useful functions are available in QorusQscriptUtil 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::initFast();
# defines from $OMQ_DIR/etc/options are available and respected
%ifdef AppXInstance
# ensure we will create a special directory under a filesystem user connection
Dir d = get_user_connection("fs-remote-2-ftp");
d.chdir("foo");
if (!d.exists()) {
d.create();
printf("created dir: %y\n", d.path());
}
%endif

Example output:

prompt% ls -l /appl/data/remote-2-ftp/
total 0
prompt% oload test.qscript
Running custom script: /home/qorus/src/qorus/work/test.qscript
created dir: /appl/data/remote-2-ftp/foo
prompt% ls -l /appl/data/remote-2-ftp/
total 0
drwxr-xr-x 2 qorus staff 68 Nov 11 22:14 foo