Deploying a sandbox may at times require the deployment of a new version of your software using artifacts. This would be the case, for example, when testing a new version of your code as part of a CI/CD pipeline.
To allow for a seamless use of artifacts in your pipeline, CloudShell Colony integrates with common artifact repository providers. For more information about adding an Artifacts Repository to your Space, see Adding an Artifacts Repository to your Space.
In this article:
- Defining Artifacts in the blueprint.yaml
- Defining Artifacts in the Application Initialization Scripts
To define artifacts in your blueprints, start by adding an artifacts section to the blueprint YAML file:
- demoapp-server: demoapp-server/production/demoapp-server.tar.gz
- demoapp-client: demoapp-client/production/demoapp-client.tar.gz
The artifact definition consists of the application name and, optionally, a default value which indicates the path to the artifact file.
List the application for which you will need to pull in an artifact. Optionally, for each application, define a default path to the artifact file. For example, in Azure Storage, the path will define the [disk name]/path/file. If you choose to leave the value empty, the user will be required to enter this value as a blueprint parameter when launching a sandbox based on this blueprint.
To learn more about blueprint parameters, see Working with Parameters.
When the deployment of the application begins, CloudShell Colony pulls the artifacts from your storage provider into your artifacts folder on your compute instance.
NOTE: In order to use multiple artifacts in a single application, you must compress all the required artifacts into a single file on your storage provider.
Make sure to properly define a parameter to hold the path to your artifacts folder on your compute instance. To deploy the artifacts, in your application's initialization script, add access to the artifact folder using the environment variable that holds the folder path.
The following is a simple script that extracts the artifact file demoapp-server.tar.gz from the artifact folder located in $ARTIFACT_PATH.
tar -xvf demoapp-server.tar.gz;
To learn more about defining and working with parameters in blueprints and applications, see Working with Parameters.