Pipelines for Applications

Typically, a monolithic application is a reference to a single repository that contains many applications, services, or micro-services. The repository may be designed this way because the application build requires a full build of all applications due to inter-dependencies.

Consider the following scenario:

A single monolithic repository contains a monolithic build script. When a commit occurs to a branch of the repository, a build script, or several build scripts, build the applications interdependently. Every application in the repository is rebuilt on every commit.

Each application in the repository is deployed differently. Each application has its own set of deployment instructions that varies from other applications in the repository.

the following nomenclature will be used:

  • mono_repo - This is the name of monolithic repository.
  • mono_app - This is the name of the application that is attached to the mono_repo.
  • AppA - This is the name of Application A in mono_repo.
  • AppB - This is the name of Application B in mono_repo.
  • AppC - This is the name of Application C in mono_repo.

Create applications

First, the applications should be created. In this example there will be four applications. They are as follows:

App NameRepositoryBranch
mono_appmono_repomaster/default
AppANone
AppBNone
AppCNone

You can find instructions for creating applications here:

Specify manifests for the applications

In this scenario, each application will need its own Pipelines manifest. These manifests will reside in the mono_repo. For this scenario you cannot use the Pipelines web UI in-app manifest, you must use in-repo manifests.

Manifest NameAppPurpose
distelli-manifest.ymlmono_appThis is the master manifest for the monolithic build. This manifest will either execute all the build steps, or call a script, makefile, or other method to build all the applications.
AppA.ymlAppAThis is the manifest for AppA and will contain the PkgInclude defining what artifacts from the build to keep. And the AppA deployment instructions.
AppB.ymlAppBThis is the manifest for AppB and will contain the PkgInclude defining what artifacts from the build to keep. And the AppB deployment instructions.
AppC.ymlAppCThis is the manifest for AppC and will contain the PkgInclude defining what artifacts from the build to keep. And the AppC deployment instructions.

Below are example “build” manifests for each application. The below manifests assume the username is jdoe.

Application: mono_app
Manifest: distelli-manifest.yml

jdoe/mono_app:
  Build:
    # This section will include the build steps to build the application.
    # An example
    - make all
    - make test

Application: AppA
Manifest: AppA.yml

jdoe/AppA:
  Build:
    # If you need some AppA specific build commands executed, you 
    #  could add them here.
    - echo "Nothing to build"
  PkgInclude:
    # This section defines what artifacts to keep from the build
    #  for this application.
    # The following syntax will keep all folders and files from
    #  the subdir AppA/
    - 'AppA/'

Application: AppB
Manifest: AppB.yml

jdoe/AppB:
  Build:
    # If you need some AppB specific build commands executed, you 
    #  could add them here.
    - echo "Nothing to build"
  PkgInclude:
    # This section defines what artifacts to keep from the build
    #  for this application.
    # The following syntax will keep all folders and files from
    #  the subdir AppB/
    - 'AppB/'

Application: AppC
Manifest: AppC.yml

jdoe/AppC:
  Build:
    # If you need some AppC specific build commands executed, you 
    #  could add them here.
    - echo "Nothing to build"
  PkgInclude:
    # This section defines what artifacts to keep from the build
    #  for this application.
    # The following syntax will keep all folders and files from
    #  the subdir AppC/
    - 'AppC/'

Each app-specific manifest describes what artifacts to store in the application release.

The app-specific manifest would also include the deployment instructions for that application. An example might look like this:

jdoe/AppC:
  Build:
    # If you need some AppC specific build commands executed, you 
    #  could add them here.
    - echo "Nothing to build"
  PkgInclude:
    # This section defines what artifacts to keep from the build
    #  for this application.
    # The following syntax will keep all folders and files from
    #  the subdir AppC/
    - 'AppC/'

  # The following constitutes deployment steps
  Env:
    # Specify deployment env variables here
    - PORT: "3000"
  PreInstall:
    # Steps to take before the release is deployed to the server
    - sudo apt-get update
    - sudo apt-get -y install nodejs
    - sudo apt-get -y install npm
  PostInstall:
    # Steps to take after the release is deployed to the server
    - cp creds/dev.json /etc/credentials.json
  Exec:
    # Starting the application
    - nodejs app.js -p $PORT

Build the application

Whenever a commit occurs to the monolothic repository mono_repo, the application mono_app will be rebuilt.

To set up builds correctly so that each separate application can be independently deployed, the DISTELLI_MANIFEST build environment variable must be specified.

DISTELLI_MANIFEST=distelli-manifest.yml,AppA.yml,AppB.yml,AppC.yml

This is specified in the mono_app. See Specifying Build Env Variables.

These are processed in order so distelli-manifest.yml must be first. Here is an example screenshot.

Build Env Variables for monolithic app

Next steps

At this point, the applications are all set up to be built as one, and deployed as separate applications. Next steps may be to create automated deploys of the individual application pieces.

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.