Pipelines for Applications

The Build section of the Pipelines for Applications application manifest contains instructions about how to build your application. A build will clone the repository, build the application, and (on success) create a release.

The manifest is read and processed in a specific order:

  1. PreBuild
  2. Build
  3. PreRelease
  4. AfterBuildSuccess
  5. AfterBuildFailure
  6. CustomVersionCmd
  7. ReleaseNotesCmd
  8. CommitData
  9. PkgInclude
  10. PkgExclude

PreBuild

Manifest Section After Before Build Deploy Restart Terminate
PreBuild N/A Build X

Typically this section is used to install and/or configure any build requirements.

username/AppName:
  PreBuild:
    - sudo apt-get -y update
    - sudo apt-get -y install npm

Note: The Puppet Pipelines based application environment variables are not available during this phase of the manifest.

Build

Manifest Section After Before Build Deploy Restart Terminate
Build PreBuild PreRelease X

This section of the manifest specifies the build and test instructions for the application.

username/AppName:
  Build:
    - cd src
    - go build -o ../bin/server
    - go test

PreRelease

Manifest Section After Before Build Deploy Restart Terminate
PreRelease Build AfterBuildSuccess X
AfterBuildFailure

This section allows you to modify the build artifacts before they are bundled into a release.

username/AppName:
  PreRelease:
    - mv target/*.java /artifacts

Note: The Puppet Pipelines based application environment variables are not available during this phase of the manifest.

AfterBuildSuccess

Manifest Section After Before Build Deploy Restart Terminate
AfterBuildSuccess PreRelease ReleaseNotesCmd X

This section occurs after the manifest Build section is successful.

username/AppName:
  AfterBuildSuccess:
    - DATE=$(date +"%Y%m%d%H%M%S%N")
    - touch BuildSuccess.$DATE

Note: The Puppet Pipelines based application environment variables are not available during this phase of the manifest.

AfterBuildFailure

Manifest Section After Before Build Deploy Restart Terminate
AfterBuildFailure PreRelease NA X

This section occurs if the manifest Build section fails on any step.

username/AppName:
  AfterBuildFailure:
    - DATE=$(date +"%Y%m%d%H%M%S%N")
    - touch BuildFailure.$DATE

Note: The Puppet Pipelines based application environment variables are not available during this phase of the manifest.

CustomVersionCmd

Manifest Section After Before Build Deploy Restart Terminate
CustomVersionCmd AfterBuildFailure ReleaseNotesCmd X

This section specifies a custom version number for the build. If a CustomVersionCmd section is not included, Pipelines for Applications will default to assigning incremental build version numbers.

username/AppName:
  CustomVersionCmd:
    - echo "$CUSTOM_VER_MAJOR.$CUSTOM_VER_MINOR.$DISTELLI_BUILDNUM"

The same custom version number cannot be repeated on an application. If your application manifest directs Pipelines for Applications to reuse a previously assigned custom version number, you’ll receive an error message.

Custom version numbers are not case-sensitive.

ReleaseNotesCmd

Manifest Section After Before Build Deploy Restart Terminate
ReleaseNotesCmd AfterBuildSuccess CommitData X

The output of the commands in this section will be in the notes for the release. See Viewing Release Notes.

username/AppName:
  ReleaseNotesCmd:
    - 'hg log -l 10 -b default'

Note: The Puppet Pipelines based application environment variables are not available during this phase of the manifest.

CommitData

Manifest Section After Before Build Deploy Restart Terminate
CommitData ReleaseNotesCmd DockerInspect X

This section specifies details for your source control so Pipelines for Applications can automatically determine the commit point at which a particular release is built. There are two keys in this section: RepoType and RepoPath.

username/AppName:
  CommitData:
    - RepoType: Git
    - RepoPath: .

DockerInspect

Manifest Section After Before Build Deploy Restart Terminate
Build CommitData PkgInclude X

This section of the manifest specifies the Docker image(s) that were built and should be tracked as image events in your application or project.

username/AppName:
  DockerInspect:
    - 'doct15/k8s-mysql-image:$DISTELLI_BUILDNUM'

PkgInclude

Manifest Section After Before Build Deploy Restart Terminate
PkgInclude DockerInspect PkgExclude X

The list of files (artifacts) to include in the application release after a build. This is a list of strings that identify paths with optional wildcards.

username/AppName:
  PkgInclude:
    # Include a single file file.txt
    - 'file.txt'
    # Include the contents of "lib" directory and all subdirectories
    - 'lib/'
    # Include all .json files in the current directory and subdirectories
    - '*.json'
    # Include all files, but no subdirectories from subdirectory "temp"
    - 'temp/*'

You can use wildcards, such as * to include everything or /*/ to include all files within subdirectories. If you skip this section no files will be bundled in your release.

You can also take a file from one directory and have it packaged up else where. Here are some examples.

username/AppName:
  PkgInclude:
    # Include a war file, but move it to the root of the tarball
    - ["dir/to/File.war","."]
    # Include some files, but move them to lib/
    - ["target/output/*.exe","lib/"]

If your manifest includes an Install section, these files will not be unbundled to the destination server on deploy.

If a file is listed in PkgInclude and PkgExclude, it will be excluded.

PkgExclude

Manifest Section After Before Build Deploy Restart Terminate
PkgExclude PkgInclude NA X

The list of files (artifacts) to NOT include in the application release after a build. This is a list of strings that identify paths with optional wildcards.

username/AppName:
  PkgExclude:
    # Exclude a single file file.txt
    - 'file.txt'
    # Exclude the contents of "lib" directory and all subdirectories
    - 'lib/'
    # Exclude all .json files in the current directory
    - '*.json'
    # Exclude all files, but no subdirectories from subdirectory "temp"
    - 'temp/*'

If your manifest includes an Install section, these files will not be unbundled to the destination server on deploy.

If a file is listed in PkgInclude and PkgExclude, it will be excluded.

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.