Skip to content

Automatic Deployment ​

With automatic deployment, Nullstone builds and deploys an application when something happens in its repository. Three things decide whether that happens for an application in an environment:

  1. A trigger. The event in the repository that the environment acts on.
  2. The Auto-deploy flag. Whether the application deploys when that trigger fires.
  3. A build configuration. How the application is built. See Auto-Build.

Each one is set per environment, so dev can deploy on every commit while production deploys only when you say so. No matter how you set them, manual deployments through the UI and the CLI are always available.

Requirements ​

  • The application has a repository (Application > Settings).
  • The repository has a GitOps connection in the stack (Stack > GitOps). The trigger lives on that connection.
  • The application does not use the Manual builder. A manual build has nothing to deploy until you push an artifact.

Triggers ​

A trigger is the event in a repository that an environment acts on. There is one trigger per repository in each environment, and it applies to every application of that repository there.

TriggerFires when
Branch pushedA commit is pushed to the chosen branch.
Tag createdA tag is created. An optional tag filter (for example v*) limits which tags match. Leave it blank to match every tag.
Release publishedA release is published in the repository.
Pull requestA commit is pushed to the chosen pull request. Preview environments only.

Pipeline environments ​

Set the trigger on the repository's GitOps connection.

  1. Open Stack > GitOps and edit the connection for the repository.
  2. Choose the trigger for each environment.
  3. Click Save.

The same page has two other columns for each environment. Neither is needed for automatic deployment.

  • enabled syncs the environment's infrastructure from the IaC files in the repository.
  • auto-apply applies what a sync changes without waiting for approval.

Preview environments ​

A preview environment chooses its trigger on its own Automation tab: a pull request or a branch for each repository.

A preview environment's Automation tab

See Preview Environments.

Turn on auto-deploy in an environment ​

Open Environment > Automation. The table lists the blocks of the stack, with applications grouped by repository.

An environment's Automation tab

ColumnMeaning
EnabledThe block is part of this environment. An enabled block is provisioned whenever the environment is launched or synced from IaC. A disabled block is left out.
Auto-deployThe application builds and deploys each time the trigger of its repository fires in this environment. Applications only.
TriggerThe trigger of the repository in this environment. A pipeline environment links to the GitOps connection. A preview environment edits it here.

Change the toggles and click Save. Changing automation requires the stack Architect role.

You can make the same change for one application from its page in the environment: open the Configuration tab and use the Automation section at the top.

Auto-deploy is not available for an application when:

  • It has no repository.
  • It builds with the Manual builder.

If the environment shows No trigger for this environment, auto-deploy can be turned on but nothing fires until a trigger is added.

TIP

Disabling a block is reversible and destroys nothing. To remove its infrastructure, destroy it from the block's Infrastructure page.

Defaults for new environments ​

Open Application > Automation. Automation defaults decide how the application is set up in environments created from now on. Existing environments keep their current settings.

DefaultMeaning
enabledNew environments include this block. It is provisioned when the environment launches.
auto_deployWhen the environment's trigger for the repository fires, the application is built and deployed there.

The same tab lists the application's pipeline environments with their current flags and trigger.

An application's Automation tab

Quick setups ​

A quick setup applies a common arrangement in one step. Quick setups are offered when you create an application and on Application > Automation.

Quick setupWhat it does
CI/CD onlyNothing deploys on its own. Deploy from your CI/CD pipeline, the CLI, or the UI.
Auto-deploy to the first environmentThe first pipeline environment deploys when its trigger fires. Promote to the rest yourself.
Auto-deploy everywhereEvery pipeline environment deploys when its trigger fires, and so do environments created later.

Applying a quick setup updates the defaults. It also offers to update the existing pipeline environments. Where one of those environments has no trigger for the repository, it adds one: a commit pushed to the base branch of the GitOps connection.

A quick setup needs a GitOps connection for the application's repository.

The second quick setup is named after your first pipeline environment. If that environment is dev, it reads Auto-deploy to dev only.

For many teams, the first environment is a dev or staging environment that doesn't require tests or approval to deploy. For production, we recommend a custom CI/CD workflow so that tests and approvals run first.

Server Applications ​

If you are launching a server application, Nullstone will launch the virtual machine and provide you with the connection information. In this case, you will need to configure your server using Chef, Puppet, Ansible, bash, or whatever tools you prefer.

To easily connect to your server, one option is to use the nullstone ssh command. Or you can configure SSH access and protect access with a Bastion and/or VPN.