An artifact is a deployable unit that is supported by a specific cartridge type (e.g., a PHP file in a PHP Cartridge, a web app (.war
) in an Application Server Cartridge etc.). Artifact Distribution Coordinator (ADC) is responsible for distributing artifacts among the cartridge instances. The artifact distribution process is referred to as Deployment synchronization.
In such instances it is important that all the changes made in the Git repository are propagated into the respective cartridge. Therefore, it is recommended to setup the automatic deployment synchronization process for this purpose.
The diagram above explains the process involved in uploading an artifact to a cartridge instance automatically. A webhook needs to be added to the remote Git repository for the deployment synchronization process to take place automatically.
When a tenant user needs to upload an artifact, they will push the artifact into their remote Git repository by issuing a git push
. This will make the GitRepo send a push event to Stratos Manager. When a git push
triggers the ADC, it will publish a Artifact Update event to the Instance Notifier topic, which is within the Message Broker. Thereafter, the relevant cartridge instances will subscribe to the Artifact Update message and update its artifacts by issuing a git pull
to the tenant user's remote Git repository.
Generally, up stream commits from the instance to the Git repository will not take place. However, if Auto Commit is enabled the instance will automatically push commits to the respective remote Git repository. Auto Commit is an optional feature.
Single tenant and multi-tenant cartridges can be present in any of the following cartridge types: data cartridge, framework cartridge and load balancer cartridge. If required, Auto Commit can only be enabled for single tenant framework cartridges or multi-tenant framework cartridges, as data cartridges and load balancer cartridges do not use Git repositories. Auto Commit is enabled at the time of deploying the application. Therefore, Auto Commit needs to be enabled by sending a payload parameter in the application definition JSON as follows:
{ "name": "payload_parameter.COMMIT_ENABLED", "value": "true" }
For example:
{ "applicationId": "single-cartridge-app", ... "components": { "cartridges": [ { "type": "php", ... "subscribableInfo": { "alias": "my-php", ... "properties" : [ { "name": "payload_parameter.COMMIT_ENABLED", "value": "true" } ] } } ] } }