Pipelines for Applications

Deploying applications is a cornerstone of Puppet Pipelines for Applications. Once you have created a release of an application in your Pipelines account, use Pipelines for Applications to deploy the application to servers in an environment.

Deploy an application

You can deploy applications from the CLI or the web UI.

Deploying with the CLI

To deploy with the CLI, you must first:

  1. Create the application in your Pipelines account.
  2. Push a release version of the application.
  3. Create an environment for the application.
  4. Add one or more servers to the environment.

When deploying, ensure you are in the application directory and have a configured distelli-manifest.yml file.

  • Deploy to an Environment: distelli deploy --env PRODUCTION
  • Deploy a Specific Release: `distelli deploy –env BETATEST –release v50
  • Deploy with Stagger Settings: distelli deploy --env TEST --stagger-delay 10 --stagger-size 2

For more information on the Pipelines CLI deploy see Pipelines CLI.

Deploying with the web UI

To deploy with the web UI, you must:

  1. Create the application in your Pipelines account.
  2. Push a release version of the application.
  3. Create an environment for the application.
  4. Add one or more servers to the environment.
  5. Ensure you are signed into the Pipelines web UI.
  6. Navigate to the application you wish to deploy.
  7. Navigate to the environment you wish to deploy to.

After you have completed the above steps, you are ready to click the Deploy button for the release you wish to deploy to this environment. You will be presented a dialog box.

New Deploy

You can set the stagger options for the deploy in this dialog. Click the Deploy Release button to deploy your application.

Automatic deployment

Auto-deploy is a feature that provides continuous delivery and continuous deployment. The auto-deploy process can be initiated by a successful build. Auto-deploy functionality is specific to an application.

For more information on auto build see Enabling auto build.

Prepare for auto-deploy

Note: To configure automatic deployment, your application must have an environment to deploy to. See Creating an environment. For auto deploy to work, the environment must have one or more servers.

  1. In the Pipelines web UI, click Applications.
  2. Navigate to the application you wish to enable auto deploy on.
  3. Ensure you are on the Overview tab.
  4. To the right you will find the App Pipeline selection.

  5. If you have not connected a repository, click Connect a repository to your pipeline.
  6. When your application is connected to a repository click the Add Pipeline for XXXXXXX branch button.
  7. You are ready to configure and enable auto deployments.

Enable auto-deploy

To enable auto deploy you must add steps to your App Pipeline. Steps consist of application environments that will be deployed to.

If you have not added an environment to your application, you can from the App Pipeline. See Creating an environment from a pipeline.

  1. In the **App Pipeline** area of the web UI, click Add Step.
  2. Select a new or existing environment to automate deploys to.
  3. Click Add Target.
  4. You now have a step in your App Pipeline. In the example below, the environment AddrBookAPI was added. Also of note, in the depicted examples here, the application already has been built, and the environment has already had successful deploys. You may not see the extra data if your application has not been built or deployed.

    App Pipeline Auto Deploy step 2
  5. Check the Auto Deploy box.
  6. The first step in auto-deploy is to deploy on successful build. This is the only option.

  7. Click Add Step.
  8. From the drop down select another environment to further automate deploys.
  9. Check the Auto Deploy box.
  10. Click the drop down next to Auto Deploy, and select the conditions under which automatic deployment should take place.
  11. For any auto deploy condition to be "stepped through," the build must be successful.

    Auto Deploy conditionExplanation
    If all Deployments completeIf all above deployments complete, deploy to the next step in the app pipeline. A completed deployment can be successful or failed.
    If all Deployments succeedIf all of the above deployments succeed, deploy to the next step in the app pipeline.
    If any Deployments completesIf ANY above deployment completes, deploy to the next step in the app pipeline. A completed deployment can be successful or failed.
    If any Deployments succeedsIf ANY above deployment succeeds, deploy to the next step in the app pipeline.

You can continue adding steps (environments) for auto-deploy. Think of the App Pipeline as the automation setup for builds and deploys.

It is strongly recommended that after setting up an App Pipeline for an application a Dashboard should be setup to visualize and provide other functionality inluding:

  • Continuous Delivery.
  • Promotion of a release from one environment to the next.
  • Ability to rollback an environment to a previous release.
  • Insights into your current builds and deployments.

Disable automatic deployment

  1. In the Pipelines web UI, click Applications.
  2. Navigate to the application you wish to disable auto deploy.
  3. Ensure you are on the Overview tab.
  4. Ensure you select the Branch you wish to disable auto deploy.
  5. For the auto deploy step you wish to remove, uncheck the Auto Deploy box.

Viewing a deployment

Application deployments can be viewed while in progress or after completion. Application deployments can be viewed in the Pipelines web UI or listed with the Pipelines CLI.

View a deployment with the web UI

Viewing an application deployment in the Pipelines web UI will give you access to logs, including live logs for deployments currently in progress.

To view your deployment:

  1. Navigate to the application you wish to see a deployment.
  2. Optional. In the Overview tab, click type in the filter bar, and select DEPLOY.
  3. Find the deployment you wish to view in the App History list and click the deploy icon or deploy number.

View a deployment with the CLI

You can list deployments for a specific application with the Pipelines CLI. The syntax is:

distelli list deployments -n APPLICATION_NAME

Here is an example session:

$ distelli list deployments -n BashSimpleApp
+---------------+------------------------+------------------------+------------------------------------------+-------------+
| App Name | Deployment Id | Release Id | Deployed | Description |
+---------------+------------------------+------------------------+------------------------------------------+-------------+
| BashSimpleApp | d-338ifi5owr769793a9f1 | a-o3tyk6v71pd096f5e609 | 2015-05-08 20:57:43 UTC (3 months ago) | Test1 |
| BashSimpleApp | d-y6d5z3wswq9b52c636f4 | a-q6qadg0zta455f189d0d | 2015-05-11 16:53:46 UTC (3 months ago) | Test2 |
| BashSimpleApp | d-ba1k0e1ahldb648a548d | a-038hp3d0fvf90e86b823 | 2015-05-11 17:03:55 UTC (3 months ago) | Test3 |
| BashSimpleApp | d-z9gyxktri772d5ba60f6 | a-e6qao45n5me8cfe5ae27 | 2015-05-29 23:07:22 UTC (2 months ago) | Test4 |
| BashSimpleApp | d-k6qwo6lphmde9f364e5d | a-e6qao45n5me8cfe5ae27 | 2015-08-17 15:58:49 UTC (40 minutes ago) | |
+---------------+------------------------+------------------------+------------------------------------------+-------------+
[email protected]:~/Applications/BashSimpleApp$

How Pipelines for Applications deploys your application

This document will technically define how Pipelines does a deployment of your application.

This will be outlined by Pipelines manifest phases. For more information on manifest phases, please see manifest.

Begin

When a deployment begins, the Pipelines agent is contacted on a host and sent the Pipelines manifest.

The Pipelines agent will create a unique directory. The name of this directory is:

/DISTELLI_ROOT/_apps/APPLICATION_NAME.ENVIRONMENT_NAME.DEPLOYMENT_ID/
  • DISTELLI_ROOT - The directory the agent was installed with using the --data-dir option. If not specified, this will default to /distelli.
  • APPLICATION_NAME - The name, in Pipelines, of the application being deployed.
  • ENVIRONMENT_NAME - The name, in Pipelines, of the application environment being deploy to.
  • DEPLOYMENT_ID - The ID, in Pipelines, of the deployment. Typically in the format of d-abcdefghijklmnopqrst.

The directory is available as an environment variable DISTELLI_INSTALLHOME

The agent creates shell scripts (or batch files for Windows deployments) for each section of the manifest. They are put in the bin/ directory under DISTELLI_INSTALLHOME.

Env

The Env section of the manifest allows a user to create environment variables that are available during every phase of the deployment. It is important to note that environment variables in the Pipelines web UI will override the same environment variable in the Pipelines manifest.

PreInstall

During this phase, the Pipelines agent will run the bin/distelli-preinstall.sh file. If there is no bin/distelli-preinstall.sh file, nothing will happen.

Install

During this phase, one of two things will happen. If the user has included steps in the Pipelines manifest for the install phase, they will be executed as bin/distelli-install.sh.

If there are no steps in the Pipelines manifest install phase, then Pipelines will deliver the Pipelines release to the server. Realize the Pipelines release is a tarball of the release artifacts from the build process that Pipelines packaged up into a release.

After the directory is created, the Pipelines agent will next retrieve the release tarball. It is important to note that the agent gunzips and untars the release inline while the stream is being delivered to the host. This can be CPU intensive.

If the application is a secure, encrypted application the Pipelines agent will decrypt the release during download.

The delivered release will be in the same directory structure, captured after the build, based on the PkgInclude and PkgExclude sections of the Pipelines manifest.

PostInstall

During this phase, the Pipelines agent will run the bin/distelli-postinstall.sh file. If there is no bin/distelli-postinstall.sh file, nothing will happen.

Stop

During this phase, the Pipelines agent will stop any previously started process in the Pipelines manifest Exec section for this application environment.

There is no Pipelines manifest section for this phase.

Flip

During this phase, the Pipelines agent will symbolically link the created deployment directory DISTELLI_INSTALLHOME to the application working directory DISTELLI_APPHOME which is in the format of:

/DISTELLI_ROOT/envs/ENVIRONMENT_NAME/

This symbolic link replaces the previous deploys symbolic link.

There is no Pipelines manifest section for this phase.

PreStart

During this phase, the Pipelines agent will run the bin/distelli-prestart.sh file. If there is no bin/distelli-prestart.sh file, nothing will happen.

Start

During this phase, the Pipelines agent will run the bin/distelli-start.sh file. If there is no bin/distelli-start.sh file, nothing will happen.

Exec

During this phase, the Pipelines agent will run the bin/distelli-exec.sh file. If there is no bin/distelli-exec.sh file, nothing will happen.

You must not use the Exec and Start sections of the manifest at the same time. Exec takes precedence if both are used. For more information see Understanding Manifest Exec vs Start.

The Exec section should be used for starting long-lived foreground processes. Any process started in this section will be monitored by the Pipelines Agent. If the process terminates, the Pipelines Agent will attempt to restart it by rerunning the bin/distelli-exec.sh script.

PostStart

During this phase, the Pipelines agent will run the bin/distelli-poststart.sh file. If there is no bin/distelli-poststart.sh file, nothing will happen.

Done

Any previous deployment DISTELLI_INSTALLHOME directory is removed.

Back to top
The page rank or the 1 our of 5 rating a user has given the page.
The email address of the user submitting feedback.
The URL of the page being ranked/rated.