Publishing an app
Publishing (also called "releasing" or "deploying") means that the application is uploaded to the VIKTOR platform, making the app available in the organization environment. Note that the source code is secure and cannot be inspected by users that have access to the online VIKTOR environment.
Watch the video below to get a quick overview of how to publish an app. The steps described in the video are:
- Creating a new application
- Publish the application source code
- Creating a new workspace
Free-tier VIKTOR developers (cloud.viktor.ai
) can only publish editor-type apps
with a public visibility on the workspace.
Publish a new app
Publishing an app requires a handshake between environment admin and the developer (which may be the same person):
- Creating a new application (developer)
- Publish the application source code (developer)
- Creating a new workspace (environment admin)
These steps are outlined in the sections below.
1. Creating a new application
Navigate to your VIKTOR environment and click App Store in the main menu.
Click on the Create app button and follow the steps:
Basic information
Labels
Images
Maintainers
Review
Please refer to the Managing apps documentation for more information on apps.
2. Publish the application source code
Free VIKTOR developers (cloud.viktor.ai
) automatically have environment admin rights.
After preparing the app in the online VIKTOR environment, the developer can publish the source code by using the
publish
command of the CLI:
viktor-cli publish
You can also override the tag and app name of your new published version by running the CLI command such below:
viktor-cli publish --registered-name <insert-app-name-here> --tag v0.1.0
- Although we use the term 'tag' as a variable for the publish command, this is not linked to the git tag. The CLI
will not check out the tag you specify in the publish command, you will have to do this manually first (e.g.
git checkout <TAG>
). - If you are using git the CLI respects the .gitignore file and uses git to gather the files for uploading to VIKTOR.
- You can force the CLI to upload all files in the app folder by using the
--use-filesystem
flag. - If you have any uncommitted changes or unstaged files, the
publish
command will fail as a safety mechanism.
The registered-name
is specified in step 1 by the developer and can be inspected using the
apps
command of the CLI:
>>> viktor-cli apps
The following apps are connected to your account:
Name | Full name | Latest tag | SDK version | Status
crane-demo | crane-demo.viktor.demo | v2.1 | 13.6.2 | published
monitoring-demo | monitoring-demo.viktor.demo | v1.1 | 13.6.1 | published
...
or in the interface in the "App Store" menu:
After pressing enter you will see a spinner which you can use to monitor the publication. Once you see the spinner it is not possible to cancel the process. It is not a problem if you accidentally close the CLI at this point, publishing will continue in the background. During publication several checks will be performed. If any problems occur you will be presented with the reason for failure. Please contact VIKTOR in case you are stuck.
3 Create / request a new workspace
You need to create a workspace for your app to make it available for other users. If you are an organization admin, you can directly create a new workspace and add users by clicking the Create workspace button:
In case you do not have administrator rights, click on the Details button:
and request a new workspace by clicking Request new:
Please refer to the Managing workspaces documentation for more detail.
Publish a new version of an existing app
Every new addition or change to the application source code requires a new release, which is done by directly publishing the source code as described in step 3 in the section above. Publishing a new version can be automated using Continuous Deployment (CD) tools.
Make sure to keep backward compatibility in mind when creating new releases.
In case of an entity type incompatible publish, follow these steps:
- Use the
publish
command with the new app code - Wait for it to fail due to the incompatible change
- Notify your contact person at VIKTOR (or send a message to support@viktor.ai) and mention the incompatible change(s)
- Await VIKTOR to republish with necessary adjustments in the database
Limitations
The following cases cannot be handled without intervention from VIKTOR. If you want to publish an app and encounter one of these limitations, please reach out to your contact person at VIKTOR to publish the application.
- It is not possible to clear the database of an app before publishing.
- It is not possible to publish an app that has incompatible entity type changes, e.g:
- Removal / renaming of entity types that are already present in the database
- Changing names of top-level entities