UNPKG

622 BJavaScriptView Raw
1// https://docs.gitlab.com/ce/ci/variables/README.html
2
3module.exports = {
4 detect: function() {
5 return !!process.env.GITLAB_CI
6 },
7
8 configuration: function() {
9 console.log(' Gitlab CI Detected')
10 var remote =
11 process.env.CI_BUILD_REPO || process.env.CI_REPOSITORY_URL || ''
12 return {
13 service: 'gitlab',
14 build: process.env.CI_BUILD_ID,
15 commit: process.env.CI_BUILD_REF,
16 branch: process.env.CI_BUILD_REF_NAME,
17 root: process.env.CI_PROJECT_DIR,
18 slug: remote
19 .split('/')
20 .slice(3, 5)
21 .join('/')
22 .replace('.git', ''),
23 }
24 },
25}