Deploy a project
Deployments in Altostra work in two phases:
- First, you publish a version of your project.
- Then, you either create or update a stack from that version.
When you create a version of a project, Altostra bundles the project together with the project's files and pushes the version to the Altostra version repository on your account. You can then deploy that version to an environment of your choice.
For more information about project versions, read the Project reference guide.
Before you begin
To push project versions you need to Git clone the project to your local development environment. the project must be registered with Altostra and you must login using the Altostra CLI.
Create a project version
To create a project version, 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-version" 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 version to that project.
Deploy using Altostra CLI
List the available versions
To view the available versions for a project, use the versions command:
alto versions
┌─────────┬────────────┬──────────────────────────┐
│ (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 stack
To create a new stack for the current project using the version v1.0 that we created, use the deploy command:
alto deploy prod:v1.0 --env Development
This command creates a new stack named "prod", or updates if it already exists, from the project version by the name "v1.0" in the "Development" environment.
Update an existing stack
When you update an existing stack, you push changes that alter that stack instead of creating more resources. Stacks are bound to environments when they are created, you must create another stack in a different environment if you wish to relocate a stack.
To update an existing stack for the current project using the version v1.0,
use the deploy, this time the --env
switch not needed and is ignored:
alto deploy prod:v1.0
This updates the stack named "prod" with the project version 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 stacks
To list the stacks for the current project, use the stacks command:
alto stacks
┌─────────┬────────┬─────────────────────────┬─────────────────┬─────────────────┬────────────┐
│ (index) │ Name │ Updated │ Environment │ Version │ 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 stack details
To list the details for a specific stack, use the stacks command followed by the stack name:
alto stacks prod
History of stack prod:
┌─────────┬───────────────┬───────────────────────────┬───────────────────────────┬──────────────────┐
│ (index) │ User │ Date │ Version │ 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 version available for that project. Please refer to the Create a project version section above. To begin, login to the Altostra Web Console.
Create a stack
To create a new stack:
- Head over to Projects in the top menu.
- Click the project that you wish to deploy.
- Click New.
- Enter a name for the stack.
- Select the Version to deploy.
- Select the Environment to which you wish to deploy.
- Click Deploy to begin the deployment.
Update an existing stack
When you update an existing stack, you push changes that alter that stack instead of creating additional resources.
Stacks are bound to environments when they are created, therefore, you cannot change the environment for an existing stack. If you wish to relocate a stack, you must create another stack in a different environment.
To update the stack
- Head over to the Project page to which the stack belongs.
- From the list stacks, select the stack you wish to update.
- Click Deploy.
- Select the Version to deploy.
- Click Deploy to begin the deployment.