summaryrefslogtreecommitdiff
path: root/doc/api/deployments.md
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 18:08:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 18:08:01 +0000
commit8e45d25f7dde6508839ffee719c0ddc2cf6b12d3 (patch)
tree9839e7fe63b36904d40995ebf519124c9a8f7681 /doc/api/deployments.md
parent00c78fb814d7ce00989ac04edd6cdaa3239da284 (diff)
downloadgitlab-ce-8e45d25f7dde6508839ffee719c0ddc2cf6b12d3.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/api/deployments.md')
-rw-r--r--doc/api/deployments.md97
1 files changed, 97 insertions, 0 deletions
diff --git a/doc/api/deployments.md b/doc/api/deployments.md
index df3a98b1dc8..27254c42e3a 100644
--- a/doc/api/deployments.md
+++ b/doc/api/deployments.md
@@ -223,3 +223,100 @@ Example of response
}
}
```
+
+## Create a deployment
+
+```
+POST /projects/:id/deployments
+```
+
+| Attribute | Type | Required | Description |
+|------------------|----------------|----------|---------------------|
+| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
+| `environment` | string | yes | The name of the environment to create the deployment for |
+| `sha` | string | yes | The SHA of the commit that is deployed |
+| `ref` | string | yes | The name of the branch or tag that is deployed |
+| `tag` | boolean | yes | A boolean that indicates if the deployed ref is a tag (true) or not (false) |
+| `status` | string | yes | The status of the deployment |
+
+The status can be one of the following values:
+
+- created
+- running
+- success
+- failed
+- canceled
+
+```bash
+curl --data "environment=production&sha=a91957a858320c0e17f3a0eca7cfacbff50ea29a&ref=master&tag=false&status=success" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments"
+```
+
+Example of a response:
+
+```json
+{
+ "id": 42,
+ "iid": 2,
+ "ref": "master",
+ "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
+ "created_at": "2016-08-11T11:32:35.444Z",
+ "status": "success",
+ "user": {
+ "name": "Administrator",
+ "username": "root",
+ "id": 1,
+ "state": "active",
+ "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+ "web_url": "http://localhost:3000/root"
+ },
+ "environment": {
+ "id": 9,
+ "name": "production",
+ "external_url": "https://about.gitlab.com"
+ },
+ "deployable": null
+}
+```
+
+## Updating a deployment
+
+```
+PUT /projects/:id/deployments/:deployment_id
+```
+
+| Attribute | Type | Required | Description |
+|------------------|----------------|----------|---------------------|
+| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
+| `deployment_id` | integer | yes | The ID of the deployment to update |
+| `status` | string | yes | The new status of the deployment |
+
+```bash
+curl --request PUT --data "status=success" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments/42"
+```
+
+Example of a response:
+
+```json
+{
+ "id": 42,
+ "iid": 2,
+ "ref": "master",
+ "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
+ "created_at": "2016-08-11T11:32:35.444Z",
+ "status": "success",
+ "user": {
+ "name": "Administrator",
+ "username": "root",
+ "id": 1,
+ "state": "active",
+ "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+ "web_url": "http://localhost:3000/root"
+ },
+ "environment": {
+ "id": 9,
+ "name": "production",
+ "external_url": "https://about.gitlab.com"
+ },
+ "deployable": null
+}
+```