TRIGGERS (for manifest)

The TRIGGERS element defines a set of deployment parameters that can be used when deploying an application with fglgar.

Note: Deployment triggers are typically not required, you can deploy your applications without them.

Syntax

[<TRIGGERS [component ='comp_name']>]
    [<DEPLOY></DEPLOY>] 
    [<UNDEPLOY></UNDEPLOY>]  
</TRIGGERS>]
  1. The comp_name specifies a set of environment context for the runtime required by the DEPLOY and UNDEPLOY programs. If not set, it defaults to the "cpn.gar.execution.local" web Application component defined in the GAS as.xcf

Child elements

The TRIGGERS element may contain the following child elements:

  1. Zero or one DEPLOY element.
  2. Zero or one UNDEPLOY element.

Usage

You use this element to specify programs (.42r or .42m) or scripts to execute when deploying and undeploying applications on the GAS. For example, you could run a program to prepare databases when deploying a Genero Archive (gar) file or clean-up databases before undeploying a gar.

Examples are shown of how to specify triggers in the MANIFEST file. Triggers can also be set using the fglgar command trigger options at the command line. For an example, go to fglgar with trigger options.

Example MANIFEST with triggers

<TRIGGERS component = 'cpn.gar.execution.local'>
  <DEPLOY>fglrun mydeploy.42r</DEPLOY>
  <UNDEPLOY>fglrun myundeploy.42r</UNDEPLOY>
</TRIGGERS>
When you deploy an application that has the DEPLOY and UNDEPLOY triggers set, the gasadmin deploy or undeploy command will deploy or undeploy the gar and run the specified program.
Important:

If the program specified in the DEPLOY fails, the entire deployment will fail. Whereas if the UNDEPLOY fails, the undeployment is still carried out.

fglgar with trigger options

In this example, the trigger options are set in the fglgar command when creating a gar file. (Line breaks have been added to improve readability.)
fglgar gar --application myapp.xcf 
   --trigger-component cpn.gar.execution.local 
   --deploy-trigger "fglrun mydeploy.42r" 
   --undeploy-trigger "fglrun myundeploy.42r"
Where:
  • The environment context component value - "cpn.gar.execution.local" - is specified by the --trigger-component
  • The deployment program is specified by the --deploy-trigger
  • The undeployment program is specified by the --undeploy-trigger

The MANIFEST file is created automatically with the trigger information. For more information on using the fglgar trigger options, type the command fglgar gar --help

Important:

If the --deploy-trigger fails, the entire deployment will fail. Whereas if the --undeploy-trigger fails, the undeployment is still carried out.

Parent elements

This element is a child of the MANIFEST element in MANIFEST file