Skip to content

Commit 1711aef

Browse files
committed
Implement initial Drone CI for this KRSv2 project.
Add the following support in .drone.yml: 1) Support for both node versions 10 and 6. 2) Support for npm audit. 3) Support for eslint. JIRA: BG-18745
1 parent 2a498b6 commit 1711aef

File tree

4 files changed

+864
-1
lines changed

4 files changed

+864
-1
lines changed

.drone.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
kind: pipeline
3+
name: check requisites (node:10)
4+
5+
platform:
6+
os: linux
7+
arch: amd64
8+
9+
steps:
10+
- name: build information
11+
image: node:10
12+
commands:
13+
- node --version
14+
- npm --version
15+
- git --version
16+
17+
- name: install
18+
image: node:10
19+
commands:
20+
- npm install
21+
22+
- name: audit
23+
image: node:10
24+
commands:
25+
- npm audit
26+
27+
- name: lint
28+
image: node:10
29+
commands:
30+
- npm run lint
31+
32+
---
33+
kind: pipeline
34+
name: unit tests (node:6)
35+
36+
platform:
37+
os: linux
38+
arch: amd64
39+
40+
steps:
41+
- name: build information
42+
image: node:6
43+
commands:
44+
- node --version
45+
- npm --version
46+
- git --version
47+
48+
- name: install
49+
image: node:6
50+
commands:
51+
- npm install
52+
53+
- name: unit-test
54+
image: node:6
55+
commands:
56+
- npm run test
57+
58+
trigger:
59+
branch:
60+
exclude:
61+
- prod/production
62+
63+
services:
64+
mongo:
65+
image: mongo:3.4
66+
67+
---
68+
kind: pipeline
69+
name: unit tests (node:10)
70+
71+
platform:
72+
os: linux
73+
arch: amd64
74+
75+
steps:
76+
- name: build information
77+
image: node:10
78+
commands:
79+
- node --version
80+
- npm --version
81+
- git --version
82+
83+
- name: install
84+
image: node:10
85+
commands:
86+
- npm install
87+
88+
- name: unit-test
89+
image: node:10
90+
commands:
91+
- npm run test
92+
93+
trigger:
94+
branch:
95+
exclude:
96+
- prod/production
97+
98+
services:
99+
mongo:
100+
image: mongo:3.4

.eslintrc.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true,
6+
"mocha": true
7+
},
8+
"globals": {
9+
"app": true, // BitGo side-effect from testutil
10+
"ethUtil": true, // BitGo side-effect from testutil
11+
"requireCommon": true
12+
},
13+
"extends": "eslint:recommended",
14+
"parserOptions": {
15+
"ecmaVersion": 6
16+
},
17+
"rules": {
18+
"operator-linebreak": ["error", "before"],
19+
"max-len": ["error", { "code": 120 } ],
20+
"indent": ["error", 2, {"SwitchCase": 1, "MemberExpression": "off"}],
21+
"linebreak-style": ["error", "unix"],
22+
"semi": ["error", "always"],
23+
"eqeqeq": ["error", "always"],
24+
"curly": "error",
25+
"no-extra-boolean-cast": "off",
26+
"no-unused-vars": ["error", {"vars": "all", "args": "none"}],
27+
"object-curly-spacing": ["error", "always", {"objectsInObjects": true, "arraysInObjects": true}],
28+
"array-bracket-spacing": ["error", "never"],
29+
"require-yield": "off",
30+
"func-call-spacing": ["error", "never"],
31+
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
32+
"key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "strict" }],
33+
"quote-props": ["error", "as-needed"],
34+
"no-console": "off",
35+
"no-empty": ["error", { "allowEmptyCatch": false }],
36+
"no-inner-declarations": "off",
37+
"no-useless-escape": "off",
38+
"func-names": "off",
39+
"generator-star-spacing": ["error", {"before": true, "after": false}],
40+
"yield-star-spacing": ["error", {"before": true, "after": false}],
41+
"no-duplicate-imports": "error", // whilst imports are not being used, if we start to use them, we do not want duplicates
42+
"no-unreachable": "error",
43+
"no-path-concat": "off",
44+
"no-process-env": "off",
45+
"no-process-exit": "off",
46+
"no-sync": "warn",
47+
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
48+
"eol-last": "error",
49+
"no-trailing-spaces": ["error", { "skipBlankLines": true, "ignoreComments": true }],
50+
"no-unneeded-ternary": "error",
51+
"switch-colon-spacing": ["error", {"before": false, "after": true}],
52+
"arrow-spacing": ["error", { "before": true, "after": true }],
53+
"no-dupe-args": "error",
54+
"no-undef": "error",
55+
"no-var": "error",
56+
"prefer-const": "error",
57+
"no-compare-neg-zero": "error",
58+
"no-extra-semi": "error",
59+
"radix": "error",
60+
"comma-spacing": ["error", { "before": false, "after": true }],
61+
"comma-dangle": ["error", "never"],
62+
"no-multi-spaces": ["error", {"ignoreEOLComments": true}],
63+
"keyword-spacing": ["error"],
64+
"space-before-blocks": ["error"],
65+
"space-infix-ops": ["error"],
66+
"spaced-comment": ["error", "always"],
67+
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1 }]
68+
}
69+
}

0 commit comments

Comments
 (0)