Commit 0d846fbd authored by Jeongmin Byun's avatar Jeongmin Byun

write README

parent f6102ac4
# gitlab-artifact-dep
This module helps managing node.js package dependency towards Gitlab artifacts.
To use this module, include information that is required to
download and sync your Gitlab artifacts in your project's `package.json`.
Provide an object value with a key `"gitlabArtifactDep"`, which includes
base url for your Gitlab API server as `baseUrl`,
base path to save your dependencies as `basePath`,
token to access the server as `token`,
and detailed information about the artifacts as `dependencies`.
`dependencies` object should have one key for each dependent project.
For each dependent project, the object should contain
project identifier as `project`, _ref_ as `ref`,
job to take artifact from as `job`, and Boolean values `install` and `link`.
When `install` is true, this module will run `$ yarn install` in the root of
the artifact after download and/or update.
When `link` is true, this module will use `$ yarn link` command to link your
dependency to the host project.
Following example is a part of the `package.json` file for
download and updating `elice-blocks` project as a dependency.
```json
{
"name": "elice-web",
"version": "18.1.2.0",
"description": "elice-web",
"author": "elice",
...
"gitlabArtifactDep": {
"baseUrl": "https://git.elicer.io/api/v4",
"token": "-wHuihVh2HwesjQTS",
"basePath": "gitlab_artifacts",
"dependencies": {
"elice-blocks": {
"project": "elice/elice-blocks",
"ref": "v0.5.2.*",
"job": "release-job",
"install": true,
"link": false
}
}
}
}
```
To download and/or update your dependencies, run exported module as a function.
```javascript
const gitlabArtifactDep = require('gitlab-artifact-dep');
gitlabArtifactDep();
```
This will return a promise instance, so you can directly return this in your
gulp task if you need to.
```javascript
gulp.task('gitlab-install', ['pre-gitlab-install'], function() {
return gitlabArtifactDep();
});
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment