Pipelines for Applications

In Puppet Pipelines for Applications, an application is code/software that you want to build and deploy. Your application may have one or more of the following:

  • Builds
  • Deployments
  • Environments
  • Releases
  • Settings

Create a new application

After you have created an application in Pipelines for Applications, you can build and deploy it.

You can also build your application as a Docker image, and upload it to your Docker Hub account. Once your application is built, you can run your application as a Docker container.

  1. In the Pipelines for Applications web UI, click Applications, then click New App.
  2. On the New Application page, select the source control you wish to use. If you have not connected a source control, select one to connect now.

    Puppet Pipelines supports:

    • GitHub
    • GitHub Enterprise
    • Bitbucket
    • Bitbucket Server
    • GitLab

    If you are connecting your source control for the first time, you may be redirected to your provider’s website, and prompted to allow Puppet Pipelines to access your repositories. Once you have granted access, you are returned to the New Application page.

    Important: If your code isn’t stored in a repository, click No Repository and follow the instructions for Creating an application without a repository.

  3. Select the repository that contains your code.
  4. Select the branches you wish to add to the application by doing one of the following:
    • If you want to add specific branch(es); choose Specific Branches and select the branch(es) you wish to select.
    • If you want to dynamically add branches that match a regular expression pattern, click Matching Regular Expression, and enter the regular expression. For example, release/.* will add all branches with the prefix release/.
  5. When you have finished selecting branches, click Next Step.

Next, you are prompted to configure your build steps. To continue, follow the instructions for your desired build type:

  • Build with Docker - If building with Docker, Pipelines for Applications will build a Docker image and push it to a Docker registry.

    Note: Building with Docker can also create a Pipelines release.

  • Build Pipelines release - If building a Pipelines for Applications release, Pipelines will build a release from your build artifacts, and store the release for deployments.

Build with Docker

If you want to build your application as a Docker file, you must have:

  • An account with one of the Docker registries Puppet Pipelines supports:

    • Docker Hub
    • Docker Private Registry
    • AWS
    • Google Cloud
  • A Dockerfile that contains the commands to build your Docker image. Add the Dockerfile to your code repository. For more information on building a Dockerfile, see the documentation on the Docker Dockerfile.

  1. In the Configure build steps section, click Build with Docker and enter your Application build steps that must be built before building your Docker image. For example:

    echo "--Sourcing nvm--"
    source ~/.nvm/nvm.sh
    
    echo "--Installing NodeJS 4.4.7--"
    nvm install v4.4.7
    
    echo "--Installing latest npm globally--"
    npm install npm -g
    
    echo "--Installing NodeJS Packages--"
    npm install
    
    echo "--Running Tests--"
    npm test
    

    Providing debug statements, like echo, can be helpful to troubleshoot failed builds.

    You do not need to add your Docker build commands. Pipelines will add these when you specify your Docker registry.

  2. Enter your application build steps in the provided Build - Steps to build and test your application field any build steps are required. Otherwise, it is safe to leave blank.

  3. Select which Docker registry you wish to use. If you are connecting your Docker registry for the first time, you will be required to enter the following information:

    • Docker Hub & Docker Private Registry
      • Email - The email used with this Docker registry.
      • Username - The username used with this Docker registry.
      • Password - The password associated with the username for this Docker registry.
      • Endpoint - The Docker registry endpoint.
    • AWS ECR Container Registry
      • Key Name - The AWS IAM name with permissions to ECR.
      • Access Key - The AWS Access key associated with the IAM role above.
      • Secret Key - The AWS Secret associated with the Access key above.
    • Google Container Registry
      • You will be required to authenticate your Google account with access to Google Cloud Container Registry.
  4. Enter the Repository Name and click Connect Repo.

    Different Docker registries represent repositories differently.

    • Docker Hub and Docker Private Registry: REGISTRY_USERNAME/REPOSITORY_NAME
    • AWS ECR Container Registry: Select from a list of available registries.
    • Google Container Registry: gcr.io/PROJECT_NAME/DOCKER_IMAGE

    After the repository is connected, your build steps should include the Docker build instructions.

    The build section of the web UI contains a section titled ### Docker Build Commands ### containing various Docker commands.

  5. Click Next Step and continue to the Review your build configuration section.

    Carefully review the contents of the App Name field. If you’re using a distelli-manifest.yml file, the App Name field must exactly match the application name set in the distelli-manifest.yml file. If there is a mismatch, the application will fail to build.

  6. Select a build image and configure auto-build permissions. When you are ready, click Looks good, Start Build!.

Build Pipelines release

  1. In the Configure build steps section, click Build Pipelines Release.

  2. In the build area, enter your application build steps (if applicable). For example:

    echo "--Sourcing nvm--"
    source ~/.nvm/nvm.sh
    
    echo "--Installing NodeJS 4.4.7--"
    nvm install v4.4.7
    
    echo "--Installing latest npm globally--"
    npm install npm -g
    
    echo "--Installing NodeJS Packages--"
    npm install
    
    echo "--Running Tests--"
    npm test
    

    Providing debug statements, like echo, can be helpful to troubleshoot failed builds.

  3. In the PkgInclude section, enter an * (asterisk). An asterisk tells Pipelines to package up all files after the build. If you’d like to specify specific files, see the PkgInclude documentation.

    The build section of the web UI contains the sample build instructions provided in step two above. The pkginclude section contains an askerisk.

  4. Click Next Step and continue to the Review your build configuration section.

    Carefully review the contents of the App Name field. If you’re using a distelli-manifest.yml file, the App Name field must exactly match the application name set in the distelli-manifest.yml file. If there is a mismatch, the application will fail to build.

  5. Select a build image and configure auto-build permissions. When you are ready, click Looks good, Start Build!.

Creating an application without a repository

If your code isn’t in a repository, use the following steps to create and build your application using Pipelines.

Before you begin: Install the Pipelines agent.

  1. Log into your Pipelines account and click Applications.
  2. Click New App.
  3. In the Connect your application to source control area, click No Repository.
  4. Configure your build steps in the Pipelines build manifest. Build steps determine how your application is built and tested. For example, if you are building a NodeJS application, and need to install NodeJS, one of your build steps can be the command npm install.
  5. To see example build steps for your programming language, click the applicable language.
  6. Download the appropriate sample build manifest (distelli-manifest.yml) to your application’s root directory.
  7. On your machine, edit the build manifest to include the build steps for your application.

    Tip: For a full description of the build steps and the order in which they are executed, see Build and Deployment Steps.

  8. When you have finished editing the build manifest, click I’ve pushed my Repo. A summary of your build configuration is shown.
  9. Give your new application a name.
  10. To create your application, click Looks good. Create App!.
  11. To build your application:
    1. Open a terminal window.
    2. Navigate to your application’s root directory, and type distelli push -m "comment", where “comment” is the comment you want to use for the build. For example, “Initial Push”.

Push an application release

You must push an application to Pipelines to create a release for deployment.

When integrating with a repository a push is initiated by the build server. A release is created after successful builds and tests.

Details of a push

When you run a distelli push, the following occurs:

  1. The Pipelines CLI reads the distelli-manifest.yml file.
  2. Any steps specified in the manifest’s PreRelease section are executed.
  3. The manifest PkgInclude and PkgExclude sections define which, if any, files to bundle into the release.
  4. The release files are tar’d and gzip’d into a bundle.
  5. The bundle is securely uploaded to the Pipelines account or the configured AWS S3 bucket.
  6. The application release number is incremented.
  7. A new release is created.
  8. The creator of the release and the time the release was created are noted.

Create an application manifest

Before you begin: Create the application using the instructions on this page.

Pushing an application requires a correctly configured distelli-manifest.yml file. For more information, see Application manifest.

The first line of the distelli-manifest.yml must be <USERNAME>/<APPLICATION_NAME>:.

An example distelli-manifest.yml file:

jdoe/SimpleApp:
Env:
- EXAMPLE: '\This is an example manifest environment variable.\'
PkgInclude:
- application.sh
Exec:
- './application.sh'

This manifest will push the application SimpleApp to the Pipelines account with user name jdoe. If pushing to a team account, the user name should be the team’s user name. The application name must match the application name in Pipelines.

Push a release

To push a release of an application you must use the Pipelines CLI. First make sure you are logged into the CLI by using the distelli login command.

$ distelli login

Email: [email protected]
Password:

Important: If you enter your account password incorrectly too many times, a Failed to login to your Distelli Account, Please check your credentials message will appear, and your account will be locked as a security precaution. The lock expires in two hours.

Now you can execute the distelli push command. This should be done from the directory where the distelli-manifest.yml file is.

[email protected]:~/SimpleApp$ distelli push
Packaged 1 files in 1 directories
Pushing App: SimpleApp
Uploading Bundle: [==========] 100%

Creating Release... DONE

You can see the release’s details in the Pipelines web UI by clicking the application’s name on the Applications page and selecting the release in the App History pane. You can also use the Pipelines CLI list command to show the release.

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.