Deploy a project
Deployments in Altostra work in two phases:
- First, you publish an image of your project.
- Then, you either create or update an instance from that image.
When you create an image of a project, Altostra bundles the project together with the project's files and pushes the image to the Altostra image repository on your account. You can then deploy that image to an environment of your choice.
For more information about project images, read the Project Image reference guide.
Before you begin
To create project images you must first clone the project Git repository to your local development environment and login using the Altostra CLI.
Create a project image
To create a project image, use the push command:
- In your local development environment open a terminal and switch to your project directory.
- Run any build process if your project requires it.
- In the terminal, run:
$ alto push v1.0
"v1.0" is just a name we use in this example, you can use any string you want, such as "my-image" or "testing-123".
When you run the command, the CLI automatically creates an Altostra project for you if there isn't one; if there is, it pushes the image to that project.
Deploy using Altostra CLI
List the available images
To view the available images for a project, use the images command:
$ alto images
┌─────────┬────────────┬──────────────────────────┐
│ (index) │ Name │ Last Modified │
├─────────┼────────────┼──────────────────────────┤
│ 0 │ 'v0.9' │ '4/29/2020, 2:18:27 PM' │
│ 1 │ 'v1.0' │ '5/24/2020, 9:48:47 PM' │
└─────────┴────────────┴──────────────────────────┘
Create a new instance
When you create a new instance, you essentially create a new "stack" or "instance" of your project, which is then updated with newer versions of your projects.
To create a new instance for the current project using the image v1.0 that we created, use the deploy command:
$ alto deploy prod:v1.0 --env Development
This command creates a new instance named "prod", or updates if it already exists, from the project image by the name "v1.0" in the "Development" environment.
Update an existing instance
When you update an existing instance, you push changes that alter that instance instead of creating more resources. Instances are bound to environments when they are created, you must create another instance in a different environment if you wish to relocate an instance.
To update an existing instance for the current project using the image v1.0,
use the deploy, this time the --env
switch not needed and is ignored:
$ alto deploy prod:v1.0
This updates the instance named "prod" with the project image by the name "v1.0".
After deploying
If the deployment mode for your organization is set to manual, then you need to follow the URL returned by the Altostra CLI deploy command to finish the deployment, for more information read about deployment modes. However, if the deployment mode is set to automatic, then the deployment starts immediately and you don't need to perform any additional steps.
List instances
To list the instances for the current project, use the instances command:
$ alto instances
┌─────────┬────────┬─────────────────────────┬─────────────────┬─────────────────┬────────────┐
│ (index) │ Name │ Updated │ Environment │ Image │ Status │
├─────────┼────────┼─────────────────────────┼─────────────────┼─────────────────┼────────────┤
│ 0 │ 'dev1' │ '5/22/2020, 1:29:41 PM' │ 'Development' │ 'NOT_AVAILABLE' │ 'Failed' │
│ 1 │ 'dev2' │ '5/24/2020, 9:48:50 PM' │ 'Development' │ 'v1.2' │ 'Deployed' │
│ 2 │ 'prod' │ '6/12/2020, 2:22:52 PM' │ 'Production' │ 'v1.1' │ 'Deployed' │
└─────────┴────────┴─────────────────────────┴─────────────────┴─────────────────┴────────────┘
List instance details
To list the details for a specific instance, use the instances command followed by the instance name:
$ alto instances prod
History of instance prod:
┌─────────┬───────────────┬───────────────────────────┬───────────────────────────┬──────────────────┐
│ (index) │ User │ Date │ Image │ Status │
├─────────┼───────────────┼───────────────────────────┼───────────────────────────┼──────────────────┤
│ 0 │ 'Daniel' │ '7/1/2020, 11:06:52 PM' │ 'v1.1' │ 'Deploying' │
│ 1 │ 'Samantha' │ '6/30/2020, 11:40:10 AM' │ 'v1.0' │ 'Deployed' │
│ 2 │ 'Jack' │ '6/15/2020, 8:19:25 PM' │ 'v0.1.5' │ 'RollbackFailed' │
│ 3 │ 'Jack' │ '6/14/2020, 3:53:06 PM' │ 'v0.1.5' │ 'Deployed' │
│ 4 │ 'Samantha' │ '6/12/2020, 1:27:23 PM' │ 'v0.1' │ 'Deployed' │
└─────────┴───────────────┴───────────────────────────┴───────────────────────────┴──────────────────┘
Deploy using the Web Console
To deploy a project from the Web Console you must already have at least one image available for that project. Please refer to the Create a project image section above. To begin, login to the Altostra Web Console.
Create an instance
When you create an instance, you essentially create a "stack" or "instance" of your project, which you can then update with newer versions of that project.
To create a new instance:
- Head over to Projects in the top menu.
- Click the project that you wish to deploy.
- On the Instances page, click Deploy.
- Select New Instance.
- Enter a name for the instance.
- Select the Image to use for the instance.
- Select the Environment to which you wish to deploy.
- Click Deploy to begin the deployment.
Update an existing instance
When you update an existing instance, you push changes that alter that instance instead of creating additional resources.
Instances are bound to environments when they are created, therefore, you cannot change the environment for an existing instance. If you wish to relocate an instance, you must create another instance in a different environment.
There are two main ways to update an instance in the Web Console:
1. From a project page
- Head over to the Project page to which the instance belongs.
- Click on Deploy in the Instances page of a project.
- Select Existing Instance.
- Select the Instance to update.
- Select the Image to use for the instance.
- Click Deploy to begin the deployment.
2. From an instance page
- Head over to the Instance page.
- Click on Deploy.
- Select the Image to use for the instance.
- Click Deploy to begin the deployment.