CloudCenter 4.8 has reached End of Life (EOL) as of November 14, 2018. See End of Support Notices for additional context.

Model an Application Using a File in Package

Overview

All Artifacts (scripts, binaries, and so forth) for a profile are now bundled into a single .zip file. This allows scripts to be available in the application VMs. When you model or deploy application, select the File in Package option from the Service Initialization scripts (see Deployment Lifecycle Scripts for additional context) dropdown menu and specify the file name.

Scripts for each VM and  its associated scripts can be bundled into a single ZIP file and referenced as an application content package in the application profile. This packaging allows for easier management of the scripts as well as the ability to enable scripts to refer to each other using relative paths without having to contain explicit download logic.

The Application package file field in the Topology Modeler's Properties General Setting field refers to the path for the following:

  • The binaries for the web service. The file is in a relative path from http://env.cliqrtech.com/.

  • The scripts for the database service.

Use Case

Scripts for each VM and  its associated scripts can be bundled into a single ZIP file and referenced as an application content package in the application profile. This packaging allows for easier management of the scripts as well as the ability to enable scripts to refer to each other using relative paths without having to contain explicit download logic.

Script Reference

The application package extracts to a temporary folder, but any scripts inside are executed from the current user's home directory (/home/cliqruser by default).


Best Practices

Follow these best practices when using application packages:

  • Before you package the scripts in a ZIP file, ensure the script has set proper execute permission.

  • When terminating scripts, ensure to terminate the script with an exit statement and the appropriate return code.

  • To reference one script from another, look for the directory of the currently executing script and reference the other script from there:

    • To store this script's directory:
      SCRIPT_DIR=`dirname "$0"`

    • To point to the other script relative to this script's path
      bash $SCRIPT_DIR/script2.sh

  • No labels
© 2017-2019 Cisco Systems, Inc. All rights reserved