Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
ea483105
Commit
ea483105
authored
Sep 07, 2016
by
Katarzyna Kobierska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve curl commend, remove blank lines
parent
dac4c5bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
doc/api/ci/lint.md
doc/api/ci/lint.md
+1
-1
lib/api/lint.rb
lib/api/lint.rb
+0
-2
No files found.
doc/api/ci/lint.md
View file @
ea483105
...
...
@@ -13,7 +13,7 @@ POST ci/lint
|
`content`
| string | yes | the .gitlab-ci.yaml content|
```
bash
curl
-
H
"Content-Type: application/json"
--request
POST https://gitlab.example.com/api/v3/ci/lint
-d
'{"content": "{ \"image\": \"ruby:2.1\", \"services\": [\"postgres\"], \"before_script\": [\"gem install bundler\", \"bundle install\", \"bundle exec rake db:create\"], \"variables\": {\"DB_NAME\": \"postgres\"}, \"types\": [\"test\", \"deploy\", \"notify\"], \"rspec\": { \"script\": \"rake spec\", \"tags\": [\"ruby\", \"postgres\"], \"only\": [\"branches\"]}}"}'
curl
-
-header
"Content-Type: application/json"
https://gitlab.example.com/api/v3/ci/lint
--data
'{"content": "{ \"image\": \"ruby:2.1\", \"services\": [\"postgres\"], \"before_script\": [\"gem install bundler\", \"bundle install\", \"bundle exec rake db:create\"], \"variables\": {\"DB_NAME\": \"postgres\"}, \"types\": [\"test\", \"deploy\", \"notify\"], \"rspec\": { \"script\": \"rake spec\", \"tags\": [\"ruby\", \"postgres\"], \"only\": [\"branches\"]}}"}'
```
Be sure to copy paste the exact contents of
`.gitlab-ci.yml`
as YAML is very picky about indentation and spaces.
...
...
lib/api/lint.rb
View file @
ea483105
module
API
class
Lint
<
Grape
::
API
namespace
:ci
do
desc
'Validation of .gitlab-ci.yml content'
params
do
requires
:content
,
type:
String
,
desc:
'Content of .gitlab-ci.yml'
end
post
'/lint'
do
error
=
Ci
::
GitlabCiYamlProcessor
.
validation_message
(
params
[
:content
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment