-
Notifications
You must be signed in to change notification settings - Fork 4
/
runfile.js
50 lines (41 loc) · 1.03 KB
/
runfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const { run, help } = require('runjs');
function clean() {
run('rm -rf node_modules');
run('rm -rf build');
}
function lint() {
run('docker-compose run --rm backend npm run lint');
}
function npm(task = '--help') {
run('docker-compose run --rm backend npm run ' + task);
}
function compile() {
run('docker-compose run --rm backend npm run build');
}
function build() {
run('docker-compose down');
run('docker-compose -f docker-compose-cleanup.yml down -v');
run('docker-compose build');
}
function test() {
run('docker-compose run -e NODE_ENV=test --rm backend npm run test');
}
function dev() {
run('docker-compose up');
}
help(test, 'Runs nodejs tests');
help(dev, 'Starts application and all dependent services');
help(npm, 'Executes npm script');
help(compile, 'Transpiles files to es5');
help(clean, 'Removes all build directories and dependencies');
help(lint, 'Runs eslint on current project');
help(build, 'Builds new docker image');
module.exports = {
clean,
lint,
npm,
build,
test,
compile,
dev,
};