Application Manifest

The above two units display the outer side of JPS usage and now let’s have a closer look at the inner side - the code of the package with all required configurations.

Note: before starting to pack your application we recommend to deploy it first to the Jelastic cloud manually and check all the required settings in order to be aware what configurations to specify in the manifest code.

JPS manifest is a file with .json extension which contains an appropriate code written in JSON format (JSON Formatter & Validator). This manifest file includes the links to the web only dependencies. This file can be named as you require. 

The code should contain a set of strings needed for successful installation of application. 
The basis of the code is represented by the following strings:

{
 "jpsVersion":"0.2"
 "jpsType": "install",
 "application": { }
}

This is a mandatory body part of the application package which includes the information about JPS version and the type of the application installation (“install” mode initiates a new environment creation required for deploy).

These basic strings should be extended with the settings required by the application you are packing. The following configuration details are included to the "application": { } parameter:

  1. Application description
  2. Environment configurations

A. Application description

First of all you need to provide some general information about the application such as its title, version, type of programming language and so on.

Sample of code:
{ application: {
      "id":"opencms",
      "name":"OpenCMS",
      "version":"8.5",
      "logo":"",
      "type":"java",
      "categories":["apps/cms","apps/popular"],
      "homepage": "",
      "description": {
          "en": "OpenCMS from Alkacon Software is a professional, easy to use website content management system. OpenCms helps content managers worldwide to create and maintain beautiful websites fast and efficiently.",
          "ru": "Russian description"
      },
     "startPage" : "/install.jsp",
     "success": {
    "text": "Dashboard success text",
    "email": "Email success text"
     }

}}

ValueDescriptionMandatory
idUnique application identifier, it is suggested using small letters while stating idyes
nameApplication nameyes
versionApplication versionyes
logoSecure http link to the logoyes
typeType due to the programming languages. Available values are:
  • java
  • php
yes
categories

Category(ies) of the Marketplace, for which the app will belong to. The available values are listed below.

If this option is not stated, application will be located in the Others category.
no
homepageApplication homepage in format of URL RFC 1738yes
descriptionDescription of application that is displayed to a user in the installation wizard. A string or associative array, where the key is the language code in IETF language tag or ISO 639‑1 format. Possible ways of providing "description" values:
  • "abc"
  • { en : "abc", ru : "абв" }
yes
startPageContext/relative path which is opened after pressing  “Open in browser” button (if sso is not used). Default value is “/”no
successThe text which will be displayed at the dashboard as a message or sent by email after successful app deployment (“email” value is optional, if it is not stated, the content from "text" value will be used for emailing)yes

In the categories parameter you can use the following values due to the Marketplace category you would like your application belong to:

Marketplace Section NameCategories Value
Popularapps/popular
Blogsapps/blogs
Micro Blogsapps/micro-blogs
Portals/CMSapps/cms
Forumsapps/forums
Image Galleriesapps/image-galleries
Wikisapps/wikis
Social Networkingapps/social-networking
Ad Managementapps/ad-management
Mailsapps/mails
Polls and Surveysapps/polls
Project Managementapps/project-management
E-Commerceapps/e-commerce
ERPapps/erp
Customer Supportapps/customer-support
Educationapps/e-learning
Musicapps/music
Videoapps/video
File Managementapps/file-management
Gamesapps/games
Cloud Toolsapps/cloud-tools
Accountingapps/accounting
Analyticsapps/analytics
Application Serverapps/app-server
Binary Repositoryapps/bin-repository
Bug Trackingapps/bug-tracking
Bundlesapps/bundles
Business Intelligenceapps/business-intelligence
Code Reviewapps/code-review
Collaborationapps/collaboration
Continuous Integrationapps/continuous-integration
CRMapps/crm
Developer Toolsapps/dev-tools
Document Managementapps/doc-management
ECMapps/ecm
Mobile Developmentapps/mobile-dev
News Aggregatorapps/news-aggregator
Planningapps/planning
Translation Toolsapps/translation-tools
Version Controlapps/vcs
RSSapps/rss
DB Toolsapps/db-tools
Guest Booksapps/guest-books
Calendarsapps/calendars
Othersapps/others

Note: that empty categories aren’t shown at the dashboard until you add any application to them. You can also specify a few categories if it is required, and your application will be shown in each of them.

B. Environment configurations

You need to specify the details about the environment your application requires for a proper performance. The settings stated in this part of the code will be used for creating and configuring the appropriate environment while package installation.

  1. TOPOLOGY section
  2. UPLOAD section
  3. DEPLOYMENTS section
  4. CONFIGS section


1. TOPOLOGY section

The  "topology":{ } section includes the data on the programming language of the environment, the required nodes with their settings and the necessity to enable such extra functions as High Availability and SSL.

Sample of code:

 "topology":{
             "ha":value,
             "engine":"value",
             "ssl":value,
             "nodes":[ ]
          },
NameDescriptionTypeValuesMandatory
haHigh Availabilitybooleantrue, falseyes
engineProgramming language versionstringjava6, java7, php5.3, php5.4, php5.5yes
sslSSLbooleantrue, falseyes
nodesThe list of node settings (mentioned below)array
no


NODES subsection

This is the "nodes":[ ] subsection of the above mentioned "topology":{ } where you can specify the amount of nodes and their main settings.

Sample of code:

     "nodes":[
                {
                   "extip":value,
                   "count":value,
                   "cloudlets":value,
                   "nodeType":"value"
                }
             ]

NameDescriptionTypeValuesMandatory
extipExternal IPbooleantrue, falseyes
countNumber of the nodes in the environmentinteger1, 2, 3, ...yes
cloudlets (or "fixedCloudlets" and "flexibleCloudlets")“cloudlets” parameter specifies the amount of flexible cloudlets for the node (the reserved will be set to 1 cloudlet by default). Fixed and flexible cloudlets can be stated separately with "fixedCloudlets" and "flexibleCloudlets" parameters.integer1, 2, 3, ...yes
nodeTypeNode typestringtomcat6, tomcat7, mysql5, apache2, nginxphp etc. (see the full list of node types below)yes

In the nodeType parameter you can use the following node type values due to the stack you want to use:

Software Stack NameNode Type Value
Tomcat 6tomcat6
Tomcat 7tomcat7
TomEE tomee 
Jetty 6jetty6 
GlassFish 3glassfish3 
Apache 2apache2 
NGINX PHPnginxphp 
MySQL mysql5 
MariaDB 5mariadb 
MariaDB 10mariadb10 
PostgreSQL 8postgres8 
PostgreSQL 9postgres9 
MongoDBmongodb 
CouchDB couchdb 
NGINX balancernginx 
Мaven maven3 
Мemcachedmemcached

Note that you can also include the desired cartridge nodes to your application JPS package (if you have any integrated to your platform). To get the required value for the nodeType parameter, open your JCA > Cluster > Templates panel and copy the string in brackets next to the necessary cartridge name (e.g. glassfish4):



2. UPLOAD section

Add the "upload":[ ] section to the code if your application requires any additional files (e.g. any library or module) to be uploaded and set:

Sample of code:

 "upload":[
             {
                "nodeType":"value",
                "sourcePath":"value",
                "destPath":"value"
             }
                       ],
NameDescriptionTypeValuesMandatory
nodeTypeNode typestringtomcat6, tomcat7, mysql5, apache2, nginxphp etc. (follow the link to the full list of node types)yes
sourcePathLink to the file for uploading (e.g. *.jar library or *.so module)stringhttp://jelatic.com/jdbc-connector.jar, http://jelatic.com/libcurl.soyes
destPathThe file system path where to save the uploaded filestring${WEBAPPS}/jdbc-connector.jar, ${HOME}/libcurl.soyes

3. DEPLOYMENTS section

The "deployments":[ ] section is responsible for setting the deploy process of the application archive to the configured environment.

Sample of code:

 "deployments":[
             {
                "archive":"value",
                "name":"value",
                "context":"value"
             }
          ]

NameDescriptionTypeValuesMandatory
archiveLink to archive in war, zip, tar.gz formatsstringhttp://jelatic.com/test.waryes
nameName of  archive to be deployedstringtest.waryes
contextThe context in which to deploy the applicationstringROOTPossible values: “ROOT”, “/” or arbitrary pathyes

4. CONFIGS section

Using the "configs":[ ] section you are able to modify any configuration file at any node (application server, database, etc) to configure application settings (e.g. configure connection setting between application server and database) and also perform database related operations: apply initial database dump, apply database patch etc.

Sample of code:

 "configs":[
             {
                "nodeType":"value",
                "restart":value,
                "replacements":[]
                "path":"value",
                "database":{},
                }
                         ]
NameDescriptionTypeValuesMandatory
nodeTypeNode typestringtomcat6, tomcat7, mysql5, apache2, nginxphp etc. (follow the link to the full list of node types)no
restartRestart (reboot) nodebooleantrue, falseyes
replacementsThe list of replacements in the configuration files on the node (mentioned below)array
no
pathThe path to the configuration file is required for replacementsstring
no
databaseThe list of database settings (mentioned below)array
no


REPLACEMENTS subsection

This is the "replacements":[ ] subsection of the above mentioned "configs":{ }. You can use as replacement any string value including any combination of placeholders.

Sample of code:

"replacements":[
                    {
                       "pattern":"value",
                       "replacement":"value"
                    },
                              ]
NameDescriptionTypeValuesMandatory
patternRegular expressions to find the stringstringcyclos\\.host\\.url\\s*=\\s*.*yes
replacementString to replacestringcyclos.host.url = ${env.url}yes


DATABASE subsection

This is the "database":[ ] subsection of the above mentioned "configs":{ } where you can specify the main db settings.

Sample of code:

"database":{
                   "name":"value",
                   "user":"value",
                   "dump":"value",
                   "patch" : "value"
                      }
NameDescriptionTypeValuesMandatory
nameName of the database to createstringcyclos3yes
userUser name in the database on behalf of which the application will be used (if a user is not stated the database will be created from root user)stringrootno
dumpLink to the application database dump (this value is optional)stringhttp://jelastic.com/cyclos3.sqlno
patchSQL query or link to such query. it is used only for SQL databases, supports replacements.stringUPDATE magento.admin_user SET password=CONCAT(MD5('qX${user.appPassword}'), ':qX'), email='${user.email}' WHERE username='admin';no