summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorKatarzyna Kobierska <kkobierska@gmail.com>2016-08-31 11:16:25 +0200
committerKatarzyna Kobierska <kkobierska@gmail.com>2016-09-07 12:10:49 +0200
commitb63d20a1064c20204defd1d78af97893eb2b3fc8 (patch)
treef0dbefcd5702a833200397705413639518408c68 /doc
parent0d81fd05b905e5fe41fee6bb48214748ccf85e78 (diff)
downloadgitlab-ce-b63d20a1064c20204defd1d78af97893eb2b3fc8.tar.gz
Add Documentation to Ci Lint API
Diffstat (limited to 'doc')
-rw-r--r--doc/api/README.md4
-rw-r--r--doc/api/ci_lint.md45
2 files changed, 48 insertions, 1 deletions
diff --git a/doc/api/README.md b/doc/api/README.md
index 96d94e08487..67ec502346e 100644
--- a/doc/api/README.md
+++ b/doc/api/README.md
@@ -41,8 +41,10 @@ following locations:
- [Sidekiq metrics](sidekiq_metrics.md)
- [System Hooks](system_hooks.md)
- [Tags](tags.md)
-- [Users](users.md)
- [Todos](todos.md)
+- [Users](users.md)
+- [Validate the .gitlab-ci.yaml](ci_lint.md)
+
### Internal CI API
diff --git a/doc/api/ci_lint.md b/doc/api/ci_lint.md
new file mode 100644
index 00000000000..2b169176dd6
--- /dev/null
+++ b/doc/api/ci_lint.md
@@ -0,0 +1,45 @@
+# Validate the .gitlab-ci.yaml
+
+Check whether your .gitlab-ci.yml file is valid.
+
+```
+POST ci/lint
+```
+
+| Attribute | Type | Required | Description |
+| ---------- | ------- | -------- | -------- |
+| `content` | hash | yes | the .gitlab-ci.yaml content|
+
+```bash
+curl --request POST "https://gitlab.example.com/api/v3/ci/lint?content=YAML+Content"
+```
+
+Example response:
+
+* valid content
+
+```json
+{
+ "status": "valid",
+ "errors": []
+}
+```
+
+* invalid content
+
+```json
+{
+ "status": "invalid",
+ "errors": [
+ "variables config should be a hash of key value pairs"
+ ]
+}
+```
+
+* without the content attribute
+
+```json
+{
+ "error": "content is missing"
+}
+```