-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunfile.js
More file actions
98 lines (82 loc) · 2.04 KB
/
Copy pathrunfile.js
File metadata and controls
98 lines (82 loc) · 2.04 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// tslint:disable-next-line
const {run, help} = require("runjs");
exports.clean = function() {
run("docker-compose run --rm smart-contracts rm -rf build");
run("rm -rf node_modules");
};
exports.lint = function() {
run("docker-compose run --rm smart-contracts yarn lint");
};
exports.build = function() {
run("docker-compose down");
run("docker-compose -f docker-compose-cleanup.yml down -v");
run("docker-compose build");
};
exports.deploy = function(env) {
if (!env) {
env = "development";
}
run(`docker-compose run --rm smart-contracts node_modules/.bin/truffle migrate --network ${env}`);
};
exports.redeploy = function(env) {
if (!env) {
env = "development";
}
run(
`docker-compose run --rm smart-contracts node_modules/.bin/truffle migrate --reset`,
);
};
exports.compile = function() {
run(
'docker-compose run --no-deps --rm smart-contracts sh -c "yarn generate"',
);
};
exports.solhint = function() {
run(
"docker-compose run --rm smart-contracts sh -c " +
'"./node_modules/solhint/solhint.js \\"contracts/**/*.sol\\""',
);
};
exports.test = function(testName) {
if (!testName) {
testName = "test/*";
}
run(
`docker-compose run --rm smart-contracts sh -c "yarn generate && node_modules/.bin/truffle test ${testName}"`,
);
};
help(
exports.deploy,
"Run all missing migrations to deploy contracts" +
" to ethereum network. Command accepts param with id of network",
);
help(
exports.redeploy,
"Run all migrations again to deploy contracts " +
"to ethereum network. Command accepts param with id of network",
);
help(
exports.compile,
"Compiles all contracts and generates typings",
);
help(
exports.solhint,
"Runs solhint on all smart contracts",
);
help(
exports.test,
"Runs tests against contracts in docker. " +
"It accepts test name as optional argument",
);
help(
exports.clean,
"Removes all build directories and dependencies",
);
help(
exports.lint,
"Runs tslint on current project",
);
help(
exports.build,
"Builds new docker image",
);