App Lifecycle
App lifecycle¶
App Creation¶
Creating a contrail app (contrail app create
) reserves the app's identifier globally. Since no two apps can share the same identifier, and app identifier can not be altered after creation, it is important to be diligent about choosing the correct identifier for your app.
contrail app create
# authorizing user...
# getting config from file system
# populating auth config from fs config...
# refreshing current user org...
# What is the Name of your app? Hello World by me@vibeiq.com
# App Identifier (must be unique): me@vibeiq.com/hello-world
# App description: Hello world app by me@vibeiq.com
# ✔ Copy template files
# ✔ Install dependencies
Publishing Apps¶
Once created, your app will need some code to run. Once you have edited the code in your actions (src/actions/
) you can update your app on the contrail cloud. We call this step publishing an app (contrail app publish
). Once an app is published, it becomes available for organizations to view.
cd ~/hello-world-app
contrail app publish
# START Deploying Application. kamal@vibeiq.com/hello-world
# authorizing user...
# getting config from file system
# populating auth config from fs config...
# refreshing current user org...
# APP Updating existing app.
# Installing production dependencies started...
# Installing production dependencies done.
# Building package...
# Building package done.
# Zipping package...
# Zipping package done.
# Uploading package to S3...
# cleaning up
# APP Updated app: Hello World by kamal@vibeiq.com
# ACTION Deploying actions.
# ACTION Deploying action: logItem
# APP Created new action definition: logItem
# WORKFLOW DEFINITION Deploying workflow definitions.
# WORKFLOW DEFINITION Deploying workflow definitions: logItemUpdate
# WORKFLOW DEFINITION Created new workflow definition definitions: logItemUpdate
# COMPLETE Deployment Complete
Installing Apps¶
After publishing an app, it can then be installed by users on the contrail platform, either through the App Marketplace or through the CLI directly (contrail app install
). The visibility of the app controls who can install it.
contrail app install
# getting config from file system
# populating auth config from fs config...
# refreshing current user org...
# Installed Apps:
# ? Which app would you like to install? kamal@vibeiq.com/hello-world
# ? [App config] API Host (string):
# APP INSTALLATION Installing apps .....
# APP INSTALLATION App installed
# ? Would you like to install the Workflows associated with this app? No
# APP INSTALLATION Not installing associated app workflows
App Ownership¶
Each app is owned by an org. The org that first creates an app is the owner of the app. App ownership can not be modified.
The owner is the only org that can modify, publish, or delete the app. Other orgs can install the app if the owner makes it available to them using the App Visibility settings below.
When you create a new app, you will be prompted to confirm the org you are signed into.
contrail app create
# | (index) | Values |
# | ----------- | ---------- |
# | orgSlug | your-org |
# | environment | production |
#
# ? Please configm if the provided configuration is correct (Use arrow keys)
# ❯ yes
# no
App Visibility¶
Private Apps¶
By default, all apps are private. It is recommended to keep apps private during initial development and testing.
visibility: private # default setting is private
Private apps can be shared¶
The owner of a private app can share it with other orgs using access grants.
Within the App Manifest, create a section called
accessGrants
. For each org that you want to share the app with, provide the org's slug identifier and the list of permissions you want to grant them. At the time of writing, the only permission available isinstall
.app.ymlvisibility: private accessGrants: - orgSlug: recipient-org permissions: - install
Public Apps¶
Once you have confidence in your app's reliability and robustness, you can submit a request to include your app on the public App Marketplace. To request approval, send an email to kamal@vibeiq.com.
If approved, the VibeIQ team will set your app's visibility to public, and you can update your app manifest to reflect this. You can make your app private again at any time, but resetting to to public will require re-approval.
visibility: public # this can be set after the vibeiq marketplace team has made your app public