forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshellcheck.star
51 lines (47 loc) · 1.04 KB
/
shellcheck.star
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
"""
This module returns a Drone step and pipeline for linting with shellcheck.
"""
load("scripts/drone/steps/lib.star", "compile_build_cmd")
load(
"scripts/drone/utils/images.star",
"images",
)
load(
"scripts/drone/utils/utils.star",
"pipeline",
)
trigger = {
"event": [
"pull_request",
],
"paths": {
"exclude": [
"*.md",
"docs/**",
"latest.json",
],
"include": ["scripts/**/*.sh"],
},
}
def shellcheck_step():
return {
"name": "shellcheck",
"image": images["ubuntu"],
"commands": [
"apt-get update -yq && apt-get install shellcheck",
"shellcheck -e SC1071 -e SC2162 scripts/**/*.sh",
],
}
def shellcheck_pipeline():
environment = {"EDITION": "oss"}
steps = [
compile_build_cmd(),
shellcheck_step(),
]
return pipeline(
name = "pr-shellcheck",
trigger = trigger,
services = [],
steps = steps,
environment = environment,
)