0.0.1 • Published 12 years ago
gitlab-ci-client v0.0.1
gitlab-ci-client
Easy access to GitLab CI for node
Install
$ npm install --save gitlab-ci-clientTests
$ npm testCoverage
$ npm run coverUsage
var gitlab = require('gitlab-ci-client')({
apiUrl: 'https://ci.gitlab.com'
, token: '<your token>'
, gitlabUrl: 'https://gitlab.com'
, strictSSL: true
, runnerToken: '<your runner token>'
})API
Projects
var projects = gitlab.projectsProjects.list()
List all projects, all owned projects, or a single project with the given id
Params
| Name | Type | Desc |
|---|---|---|
| id | String, Number | owned or project id (optional) |
| cb | Function | function(err, projects, res) |
Projects.create()
Create a new project with the given data
Params
| Name | Type | Desc |
|---|---|---|
| data | Object | The params to create |
| cb | Function | function(err, body) |
Where data requires:
nameThe project namegitlab_idThe GitLab Project IDgitlab_urlThe web url of the project on GitLabssh_url_to_repoThe ssh url of the project on GitLab
And can also have:
scripts(Array or string)default_ref(Defaults to master)
Projects.update()
Updates the project with the given id
Params
| Name | Type | Desc |
|---|---|---|
| id | String, Number | The project id |
| data | Object | The params to create |
| cb | Function | function(err, body) |
Where data requires:
nameThe project namegitlab_idThe GitLab Project IDgitlab_urlThe web url of the project on GitLabssh_url_to_repoThe ssh url of the project on GitLab
And can also have:
scripts(Array or string)default_ref(Defaults to master)
Projects.del()
Deletes the project with the given id
Params
| Name | Type | Desc |
|---|---|---|
| id | String, Number | The project id |
| cb | Function | function(err, body) |
Projects.link()
Adds a runner to the given project id
Params
| Name | Type | Desc |
|---|---|---|
| id | String, Number | The project id |
| runnerId | String, Number | The runner id |
| cb | Function | function(err, body) |
Projects.unlink()
Remove a runner from the given project id
Params
| Name | Type | Desc |
|---|---|---|
| id | String, Number | The project id |
| runnerId | String, Number | The runner id |
| cb | Function | function(err, body) |
Runners
var runners = gitlab.runnersRunners.list()
List all of the registered runners
Params
| Name | Type | Desc |
|---|---|---|
| cb | Function | function(err, body) |
Runners.register()
Registers the runner with the given data
Params
| Name | Type | Desc |
|---|---|---|
| data | Object | The runner info |
| cb | Function | function(err, body) |
Builds
var builds = gitlab.buildsBuilds.run()
Tells the coordinator to run this next build
Params
| Name | Type | Desc |
|---|---|---|
| token | String | The runner token |
| cb | Function | function(err, body) |
Builds.update()
Updates the coordinator with the info for the given build id
Params
| Name | Type | Desc |
|---|---|---|
| id | Number | The build id |
| token | String | The runner token |
| data | Object | The build info |
| cb | Function | function(err, body) |
Where data can have:
state(String)trace(String)
Author
Evan Lucas
License
MIT
0.0.1
12 years ago