Pipelines for Applications

The Terminate section of the Pipelines for Applications application manifest contains instructions about how to terminate your application. A terminate will stop the existing application process that was started with a manifest’s Exec section, then remove the application from the server.

The manifest is read and processed in a specific order:

  1. Env
  2. PreTerminate
  3. Terminate
  4. PostTerminate

Env

Manifest Section After Before Build Deploy Restart Terminate
Env NA PreInstall X
NA PreRestart X
NA PreTerminate X

This is an ordered map of key-value pairs that specify any environment variables that must be set before the application is started. These environment variables are available to the commands in all the sections of the deploy, restart, and terminate manifest.

These variables are not available during builds.

username/AppName:
  Env:
    - PORT: "8080"
    - DATE: '`date -u`'
    - RVM_HOME: '/usr/local/rvm'
    - SOME_VAR: '`cat /path/to/some/file`'

PreTerminate

Manifest Section After Before Build Deploy Restart Terminate
PreTerminate NA Terminate X

This is a list of commands to run during the PreTerminate step of the deployment. If this section is omitted, the PreTerminate step is skipped.

In the PreTerminate section you can specify commands to prepare to terminate your application.

username/AppName:
  PreRestart:
    - echo "Running PreRestart step"
    - remove-from-loadbalancer.sh
    - sleep 10

Terminate

Manifest Section After Before Build Deploy Restart Terminate
Terminate PreTerminate PostTerminate X

This is a list of commands to run during the Terminate step of terminate task. If this section is omitted, the Terminate step is skipped.

Use the Terminate section to issue the commands to terminate your deployed application. It is during this phase that the Pipelines agent will remove your application from the deployed to server.

username/AppName:
  Terminate:
    - sudo service nginx stop

PostTerminate

Manifest Section After Before Build Deploy Restart Terminate
PostTerminate Terminate NA X

This is a list of commands to run after a deployed application has been terminated. If this section is omitted, the PostTerminate step is skipped.

username/AppName:
  PostTerminate:
    - echo "Application Terminated"
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.