<!-- https://staircase.co/delivery/shipping/pipeline -->
# Pipeline

# Pipeline

The orchestration primitive that runs the shipping stages as one sequence.

The stages exist as separate products — Code, Assess, Build, Deploy, Comply and publication through Marketplace — and this is the thing that runs them in order, as a single automated action against a repository.

Keeping the stages independently callable and the sequence separate is what allowed a stage to be run alone. Re-running assessment against a repository without deploying it is a normal operation, not a special mode.

What is recorded is the action itself plus the deployment surface behind it — creating a pipeline, deploying it, and the dynamic form that deploys one built for a specific service.

## Operations

<!--source:api-specifications-->

### Action
<!--/source-->

`POST` `/run-action`

<!--source:api-specifications-->

#### Run Action
<!--/source-->

`run_action`

<!--source:api-specifications-->
Run Action.
<!--/source-->

<!--source:api-specifications-->

#### Run Action

<!--/source-->

##### Other responses

`201`

<!--source:api-specifications-->

### Operations
<!--/source-->

`POST` `/deployment`

<!--source:api-specifications-->

#### Run deployment to root
<!--/source-->

<!--source:api-specifications-->
Run deployment process for given service from branch to the root account

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
3 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `branch`required | `string` | <!--source:api-specifications-->Git branch to use<!--/source--> |
| `environment`required | `string` | <!--source:api-specifications-->can be dev or test<!--/source--> |
| `project`required | `string` | <!--source:api-specifications-->name of project(repository name)<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
3 fields
<!--/source-->
<!--source:api-specifications-->
Deployment created
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `status` | `string` | <!--source:api-specifications-->Status of triggered deployment<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Information about deployment<!--/source--> |
| `execution_id` | `string` | <!--source:api-specifications-->ID of deployment using which user can retrieve status<!--/source--> |

`GET` `/deployment/{execution_id}/status`

<!--source:api-specifications-->

#### Get deployment status
<!--/source-->

<!--source:api-specifications-->
Get deployment status for the deployment to any account using execution_id

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `execution_id` required | `string` path | — |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Status for provided execution
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `deployment_status` | `string` | <!--source:api-specifications-->Status of deployment<!--/source--> |
| `description` | `string` | <!--source:api-specifications-->Deployment description<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Provided execution id does not exists
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |
| `description` | `string` | <!--source:api-specifications-->Error description<!--/source--> |

`POST` `/dynamicDeployment`

<!--source:api-specifications-->

#### Run deployment on given account
<!--/source-->

<!--source:api-specifications-->
Run deployment process for given service from branch at any accoun

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
6 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `branch`required | `string` | <!--source:api-specifications-->use github sha commit<!--/source--> |
| `project`required | `string` | <!--source:api-specifications-->name of project(repository name)<!--/source--> |
| `bucket`required | `string` | <!--source:api-specifications-->name of bucket where place artifacts for sandbox:sandbox-account-artifacts<!--/source--> |
| `bundle_id`required | `string` | <!--source:api-specifications-->sha commit<!--/source--> |
| `accessKey`required | `string` | <!--source:api-specifications-->access key for account, ask devops for providing keys<!--/source--> |
| `secretKey`required | `string` | <!--source:api-specifications-->secret key for account, ask devops for providing keys<!--/source--> |

##### Other responses

`200`

`POST` `/v3/deployments`

<!--source:api-specifications-->

#### Start deployment pipeline
<!--/source-->

<!--source:api-specifications-->
Deploy service to a given account

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
6 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `project_name`required | `string` | <!--source:api-specifications-->name of github repository<!--/source--> |
| `access_key`required | `string` | <!--source:api-specifications-->environment credentials<!--/source--> |
| `secret_key`required | `string` | <!--source:api-specifications-->environment credentials<!--/source--> |
| `env` | `string` | — |
| `branch` | `string` | <!--source:api-specifications-->branch to be deployed if different from master<!--/source--> |
| `domain_name`required | `string (hostname)` | <!--source:api-specifications-->domain name of the environment to deploy<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Pipeline execution created
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `bundle_id` | `string (uuid)` | — |

##### Other responses

`400`

`GET` `/v3/deployments/{bundle_id}`

<!--source:api-specifications-->

#### Get status of current deployment
<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Description |
| --- | --- | --- |
| `bundle_id` required | `string (uuid)` path | — |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Deployment status
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `bundle_id` | `string (uuid)` | — |
| `status` | `string` | — |

##### Other responses

`404`

## Errors

`400``404`

## More in Shipping

- Previous product: Health
