Skip to content

Latest commit

 

History

History
347 lines (181 loc) · 7.28 KB

REFERENCE.md

File metadata and controls

347 lines (181 loc) · 7.28 KB

Reference

Table of Contents

Classes

Private Classes

  • application::common: Boring implementation details

Defined types

Tasks

  • activate: Activate a deployment of an application
  • deploy: Create a new deployment for an application
  • list: List applications and deployments
  • prune: Prune old deployments of an application
  • remove: Remove a deployment from an application

Defined types

application

Declare an application to orchestrate deployments

Parameters

The following parameters are available in the application defined type:

application

Data type: String[1]

Name of the application to deploy

environment

Data type: String[1]

Environment of the application to deploy

path

Data type: Stdlib::Absolutepath

Path of the application

deploy_user

Data type: Optional[String[1]]

User used to deploy the application

Default value: undef

deploy_group

Data type: Optional[String[1]]

Group used to deploy the application

Default value: undef

user_mapping

Data type: Hash[String[1], String[1]]

User mapping for managing deployment file permissions

Default value: {}

group_mapping

Data type: Hash[String[1], String[1]]

Group mapping for managing deployment file permissions

Default value: $user_mapping

kind

Data type: Optional[String[1]]

Kind of the application to deploy

Default value: undef

retention_min

Data type: Integer[1]

Minimum number of deployments to keep on disk when pruning

Default value: 5

retention_max

Data type: Optional[Integer[1]]

Maximum number of deployments to keep on disk after deploying a new deployment (enable auto-pruning)

Default value: undef

application::kind

Hooks are run from the deployment directory as the user configured by deploy_user in the application.

The following hooks are available:

  • before_deploy
  • after_deploy
  • before_activate
  • after_activate

A before_* hook returning with a non-zero exit code aborts the operation. The exit code of after_* hooks is ignored.

The following environment variables are set for each hook invocation:

  • APPLICATION_NAME - The name of the application (e.g. "acme")
  • APPLICATION_PATH - The path of the application (e.g. "/opt/acme")
  • ENVIRONMENT - The name of the environment (e.g. "production")
  • DEPLOYMENT_NAME - The name of the deployment (e.g. "d3")
  • DEPLOYMENT_PATH - The path of the deployment (e.g. "/opt/acme/d3")
  • USER_MAPPING_* - User mappings
  • GROUP_MAPPING_* - Group mappings

Each hook can be set using the corresponding *_content or *_source parameter.

Parameters

The following parameters are available in the application::kind defined type:

before_deploy_content

Data type: Optional[String[1]]

Default value: undef

before_deploy_source

Data type: Optional[String[1]]

Default value: undef

after_deploy_content

Data type: Optional[String[1]]

Default value: undef

after_deploy_source

Data type: Optional[String[1]]

Default value: undef

before_activate_content

Data type: Optional[String[1]]

Default value: undef

before_activate_source

Data type: Optional[String[1]]

Default value: undef

after_activate_content

Data type: Optional[String[1]]

Default value: undef

after_activate_source

Data type: Optional[String[1]]

Default value: undef

Tasks

activate

Activate a deployment of an application

Supports noop? false

Parameters

application

Data type: String[1]

The application to operate on

environment

Data type: String[1]

The environment to operate on

deployment_name

Data type: String[1]

The name of the deployment to activate

deploy

Create a new deployment for an application

Supports noop? false

Parameters

application

Data type: String[1]

The application to operate on

environment

Data type: String[1]

The environment to operate on

url

Data type: String[1]

The url of the artifact of the deployment

deployment_name

Data type: Optional[String[1]]

The name of the deployment to create

headers

Data type: Optional[Hash[String[1], String[1]]]

Extra HTTP headers

list

List applications and deployments

Supports noop? false

prune

Prune old deployments of an application

Supports noop? false

Parameters

application

Data type: String[1]

The application to operate on

environment

Data type: String[1]

The environment to operate on

keep

Data type: Integer[1]

The number of MRU deployments to keep

remove

Remove a deployment from an application

Supports noop? false

Parameters

application

Data type: String[1]

The application to operate on

environment

Data type: String[1]

The environment to operate on

deployment_name

Data type: String[1]

The name of the deployment to remove