Offline Deploy

New or updated Fabric project implementations must be deployed to the server.

Deployment into non-development servers shall be carefully done, verifying that the right changes will be applied. Verification can be done by code-reviews (a human process), as well as by tools that perform 3rd-party dependency vulnerability checks and code analysis for quality & security.

Such deployment, which is not done from the Fabric Studio, is called an Offline Deploy, and Fabric provides 2 main methods for performing it:

  • In the Fabric server itself, using a Deploy script.
  • Remotely, using API calls.

These methods should be used only after the prebuilt project artifacts - aimed for deployment - have passed verifications. Moreover, your CI/CD tools responsible for the verification pipeline, can performs the Offline Deploy actions.

Offline Deployment using Build and Deploy scripts

There are 2 ways to perform this Offline Deployment method:

  • Build and deploy in 2 steps: First, build the artifacts in either the Fabric Studio or a server, using the buildArtifacts script. Then, perform the deployment by running either the Fabric Deploy command on the target Fabric server or the buildAndDeployArtifacts script (using the DEPLOYONLY flag) or by using API calls.

Building artifacts in a server is aimed to be done by CI/CD tool, using a docker image that contains Fabric in it. This way, Fabric is not required to run for building the artifacts.

  • Build and deploy in one step. Build and deploy in the target Fabric server using the buildAndDeployArtifacts script.Use the k2cloud UI.

Build and Deploy in Two Steps

To build the artifacts in the Fabric Studio:

  1. Right-click the object (for example, Web Services) and click Build Deploy Artifacts. A notification displays following a successfully built of the artifacts.

16_03_offline_deploy1

  1. Right-click the same object and select Open Folder. The Windows Explorer opens in the following location: [Your PC Folder]\K2View Fabric Studio\Projects\[Project Name]\Implementation\LogicalUnits\[LU Name].

  2. Look for the ludb.JAR and ludbXMLs.ZIP files.

To build the artifacts in a server, run the buildArtifacts.sh script.

Copy the ludb.JAR and ludbXMLs.ZIP files of the relevant LUs into the target Fabric server, and run the Fabric Deploy command using the following syntax:

DEPLOY <LUT> WITH JAR <'jar_path'> ZIP_FILE <'zip path'> [WS_METHODS <'string'>] NOSYNC <Boolean>.

Note that if the LUT parameter is populated by k2_ws (the Web Services LU Type), you can populate the WS_METHODS using the list of web services to be deployed. If this parameter is not populated or is skipped, the whole Web Services LU Type, with all web services it contains, will be eployed into the Fabric server.

Example:

DEPLOY k2_ws WITH JAR '/home/k2view/AutoTests/Data/StudioProject/QA/Implementation/LogicalUnits/k2_ws/ludb.jar' ZIP_FILE '/home/k2view/AutoTests/Data/StudioProject/QA/Implementation/LogicalUnits/k2_ws/ludbXMLs.zip' WS_METHODS 'dbQueryOnAnyDB' NOSYNC true;

Build and Deploy in One Step

To build the artifacts and the deployment together, in one step, from the server, run the buildAndDeployArtifacts script.

Build and Deploy Scripts Syntax and Options

The following table describes the syntax and the mandatory/optional parameters for calling the deployment scripts. The scripts are located under $K2_HOME/fabric/scripts in the Fabric server.

Build Artifacts

buildArtifacts.sh for Linux or

buildArtifacts.bat for Windows

Description: Build the artifact files.

Usage: ./buildArtifacts.sh [-h --help] -pd [PATH_TO_PROJECT] -l [LUTNAME] -d [OUTPUT DIRECTION]

Options:

  • -h/--help displays the usage of the script.
  • -pd [PROJ_NAME] - mandatory parameter. Sets the path to the project.
  • -l [LUTNAME] - optional parameter. If not set, the artifacts are created for the entire project.
  • -d [OUTPUT DIRECTION] - optional parameter. If not set, the artifacts are created in the given/each LU folder.

Build and Deploy Artifacts

buildAndDeployArtifacts.sh for Linux or buildAndDeployArtifacts.bat for Windows

Description: Build and deploy the artifact files.

Usage: ./buildAndDeployArtifacts.sh -pd [PATH_TO_PROJECT] -s [NOSYNC] -l [LUT_NAME] -u [USER] -p [PASSWORD] -d [DEPLOYONLY]

Options:

  • -h/--help - displays the usage of the script.
  • -pd [PROJ_NAME] - mandatory parameter. Sets the path to the project.
  • -s [NOSYNC] - optional parameter. Default is True.
  • -l [LUTNAME] - optional parameter. If not set, the deploy runs for the entire project.
  • -u [USER] - optional parameter. Default is admin.
  • -p [PASSWORD] - optional parameter. Default is admin.
  • -d [DEPLOYONLY] - optional parameter. If True, the script runs only a deploy command, without creating and deleting the artifacts.

Deploy Command Syntax and Options

The following table describes the syntax and the mandatory/optional parameters when invoking the deploy command on the Fabric server. Note that for deployment, you can also run the buildAndDeployArtifacts script, using the DEPLOYONLY flag.

DEPLOY

Usage: DEPLOY <LUT> WITH JAR <'jar_path'> ZIP_FILE <'zip path'> [WS_METHODS <'string'>] NOSYNC <Boolean>.

Options:

  • LUT - Logical Unit Type name.
  • JAR - mandatory parameter. Path to JAR file, relative to USER_DIR.
  • ZIP_FILE - optional parameter. Path to ZIP file, relative to USER_DIR.
  • NOSYNC - gets Boolean value:
    • NOSYNC TRUE: Only schema changes trigger a sync after deploy.
    • NOSYNC FALSE: Any deploy (even without any changes) triggers a sync on the first time the instance is accessed.
    Note that NOSYNC FALSE is equivqlent to checking the Force Upgrade Post Deploy checkbox in the Server Configuration window in the Fabric Studio.
  • SOFT_DEPLOY - optional. Default is False.
    • In case the value of this parameter is set to TRUE, the deploy is performed without these automatic processes: user jobs, parsers and interface listener, deploy.flow.
  • WS_METHODS - optional. When LU Type = Web Services (k2_ws), specify which methods are selected, separated by “,”. Empty for all.

Offline Deployment using API calls

Request URL Format

POST https://<FABRIC-IP>:<FABRIC-PORT>/deploy?luName=<LUT-NAME>[&noSync=true|false][&softDeploy=true|false][&methodList=<LIST-OF-METHODS>]&[token=<APIKEY>][user=<USER-NAME>&password=<PASSWORD>]

Parameters

Parameter

Description

Mandatory

Default

luName

The name of the LUT that shall be deployed. Each deploy command manages only a single LUT.

Y

noSync

Indicates if deploy shall run in a no-sync mode, applying only schema changes, but without triggering a sync.

N

false

softDeploy

Indicates if deploy shall run in a soft deploy mode - without triggering automatic processes.

N

false

methodList

Specifies which methods to be deployed, when luName=k2_ws (Web Services). Method names shall be separated by “,”. When empty or not sent - whole methods are deployed.

N

Authentication & Authorization

  • Authentication is done by either user and password (user & password parameters) or an API Key (token parameter), that shall be sent as parameters.
  • The request caller shall be authorized with the right permissions to perform the deploy on the required LUT / web-services. See here for more information.

Request Body

Body parameters, along with the deployment files, to be sent with ContentType header = multipart/form-data.

Parameter

Description

Mandatory

jar

Path to the JAR file

Y

projectXmlData

Path to the ludbXMLs ZIP file. When not specified, only Java files will be deployed.

N

Previous

Offline Deploy

New or updated Fabric project implementations must be deployed to the server.

Deployment into non-development servers shall be carefully done, verifying that the right changes will be applied. Verification can be done by code-reviews (a human process), as well as by tools that perform 3rd-party dependency vulnerability checks and code analysis for quality & security.

Such deployment, which is not done from the Fabric Studio, is called an Offline Deploy, and Fabric provides 2 main methods for performing it:

  • In the Fabric server itself, using a Deploy script.
  • Remotely, using API calls.

These methods should be used only after the prebuilt project artifacts - aimed for deployment - have passed verifications. Moreover, your CI/CD tools responsible for the verification pipeline, can performs the Offline Deploy actions.

Offline Deployment using Build and Deploy scripts

There are 2 ways to perform this Offline Deployment method:

  • Build and deploy in 2 steps: First, build the artifacts in either the Fabric Studio or a server, using the buildArtifacts script. Then, perform the deployment by running either the Fabric Deploy command on the target Fabric server or the buildAndDeployArtifacts script (using the DEPLOYONLY flag) or by using API calls.

Building artifacts in a server is aimed to be done by CI/CD tool, using a docker image that contains Fabric in it. This way, Fabric is not required to run for building the artifacts.

  • Build and deploy in one step. Build and deploy in the target Fabric server using the buildAndDeployArtifacts script.Use the k2cloud UI.

Build and Deploy in Two Steps

To build the artifacts in the Fabric Studio:

  1. Right-click the object (for example, Web Services) and click Build Deploy Artifacts. A notification displays following a successfully built of the artifacts.

16_03_offline_deploy1

  1. Right-click the same object and select Open Folder. The Windows Explorer opens in the following location: [Your PC Folder]\K2View Fabric Studio\Projects\[Project Name]\Implementation\LogicalUnits\[LU Name].

  2. Look for the ludb.JAR and ludbXMLs.ZIP files.

To build the artifacts in a server, run the buildArtifacts.sh script.

Copy the ludb.JAR and ludbXMLs.ZIP files of the relevant LUs into the target Fabric server, and run the Fabric Deploy command using the following syntax:

DEPLOY <LUT> WITH JAR <'jar_path'> ZIP_FILE <'zip path'> [WS_METHODS <'string'>] NOSYNC <Boolean>.

Note that if the LUT parameter is populated by k2_ws (the Web Services LU Type), you can populate the WS_METHODS using the list of web services to be deployed. If this parameter is not populated or is skipped, the whole Web Services LU Type, with all web services it contains, will be eployed into the Fabric server.

Example:

DEPLOY k2_ws WITH JAR '/home/k2view/AutoTests/Data/StudioProject/QA/Implementation/LogicalUnits/k2_ws/ludb.jar' ZIP_FILE '/home/k2view/AutoTests/Data/StudioProject/QA/Implementation/LogicalUnits/k2_ws/ludbXMLs.zip' WS_METHODS 'dbQueryOnAnyDB' NOSYNC true;

Build and Deploy in One Step

To build the artifacts and the deployment together, in one step, from the server, run the buildAndDeployArtifacts script.

Build and Deploy Scripts Syntax and Options

The following table describes the syntax and the mandatory/optional parameters for calling the deployment scripts. The scripts are located under $K2_HOME/fabric/scripts in the Fabric server.

Build Artifacts

buildArtifacts.sh for Linux or

buildArtifacts.bat for Windows

Description: Build the artifact files.

Usage: ./buildArtifacts.sh [-h --help] -pd [PATH_TO_PROJECT] -l [LUTNAME] -d [OUTPUT DIRECTION]

Options:

  • -h/--help displays the usage of the script.
  • -pd [PROJ_NAME] - mandatory parameter. Sets the path to the project.
  • -l [LUTNAME] - optional parameter. If not set, the artifacts are created for the entire project.
  • -d [OUTPUT DIRECTION] - optional parameter. If not set, the artifacts are created in the given/each LU folder.

Build and Deploy Artifacts

buildAndDeployArtifacts.sh for Linux or buildAndDeployArtifacts.bat for Windows

Description: Build and deploy the artifact files.

Usage: ./buildAndDeployArtifacts.sh -pd [PATH_TO_PROJECT] -s [NOSYNC] -l [LUT_NAME] -u [USER] -p [PASSWORD] -d [DEPLOYONLY]

Options:

  • -h/--help - displays the usage of the script.
  • -pd [PROJ_NAME] - mandatory parameter. Sets the path to the project.
  • -s [NOSYNC] - optional parameter. Default is True.
  • -l [LUTNAME] - optional parameter. If not set, the deploy runs for the entire project.
  • -u [USER] - optional parameter. Default is admin.
  • -p [PASSWORD] - optional parameter. Default is admin.
  • -d [DEPLOYONLY] - optional parameter. If True, the script runs only a deploy command, without creating and deleting the artifacts.

Deploy Command Syntax and Options

The following table describes the syntax and the mandatory/optional parameters when invoking the deploy command on the Fabric server. Note that for deployment, you can also run the buildAndDeployArtifacts script, using the DEPLOYONLY flag.

DEPLOY

Usage: DEPLOY <LUT> WITH JAR <'jar_path'> ZIP_FILE <'zip path'> [WS_METHODS <'string'>] NOSYNC <Boolean>.

Options:

  • LUT - Logical Unit Type name.
  • JAR - mandatory parameter. Path to JAR file, relative to USER_DIR.
  • ZIP_FILE - optional parameter. Path to ZIP file, relative to USER_DIR.
  • NOSYNC - gets Boolean value:
    • NOSYNC TRUE: Only schema changes trigger a sync after deploy.
    • NOSYNC FALSE: Any deploy (even without any changes) triggers a sync on the first time the instance is accessed.
    Note that NOSYNC FALSE is equivqlent to checking the Force Upgrade Post Deploy checkbox in the Server Configuration window in the Fabric Studio.
  • SOFT_DEPLOY - optional. Default is False.
    • In case the value of this parameter is set to TRUE, the deploy is performed without these automatic processes: user jobs, parsers and interface listener, deploy.flow.
  • WS_METHODS - optional. When LU Type = Web Services (k2_ws), specify which methods are selected, separated by “,”. Empty for all.

Offline Deployment using API calls

Request URL Format

POST https://<FABRIC-IP>:<FABRIC-PORT>/deploy?luName=<LUT-NAME>[&noSync=true|false][&softDeploy=true|false][&methodList=<LIST-OF-METHODS>]&[token=<APIKEY>][user=<USER-NAME>&password=<PASSWORD>]

Parameters

Parameter

Description

Mandatory

Default

luName

The name of the LUT that shall be deployed. Each deploy command manages only a single LUT.

Y

noSync

Indicates if deploy shall run in a no-sync mode, applying only schema changes, but without triggering a sync.

N

false

softDeploy

Indicates if deploy shall run in a soft deploy mode - without triggering automatic processes.

N

false

methodList

Specifies which methods to be deployed, when luName=k2_ws (Web Services). Method names shall be separated by “,”. When empty or not sent - whole methods are deployed.

N

Authentication & Authorization

  • Authentication is done by either user and password (user & password parameters) or an API Key (token parameter), that shall be sent as parameters.
  • The request caller shall be authorized with the right permissions to perform the deploy on the required LUT / web-services. See here for more information.

Request Body

Body parameters, along with the deployment files, to be sent with ContentType header = multipart/form-data.

Parameter

Description

Mandatory

jar

Path to the JAR file

Y

projectXmlData

Path to the ludbXMLs ZIP file. When not specified, only Java files will be deployed.

N

Previous