File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed
ci/images/static-checks/content/bin Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 57
57
imagePullPolicy : Always
58
58
script : |
59
59
#!/usr/bin/env bash
60
- /opt/ static-checks/bin/shellcheck.sh --workspace_dir $(workspaces.source.path)
60
+ $(workspaces.source.path)/ci/images/ static-checks/content /bin/shellcheck.sh --workspace_dir $(workspaces.source.path)
61
61
workspaces :
62
62
- name : source
63
63
- name : yamllint
78
78
imagePullPolicy : Always
79
79
script : |
80
80
#!/usr/bin/env bash
81
- /opt/ static-checks/bin/yamllint.sh --workspace_dir $(workspaces.source.path)
81
+ $(workspaces.source.path)/ci/images/ static-checks/content/ bin/yamllint.sh --config-file $(workspaces.source.path)/ci/images/static-checks/content/config/yamllint.yaml --workspace_dir $(workspaces.source.path)
82
82
workspaces :
83
83
- name : source
84
84
- name : hadolint
98
98
image : quay.io/redhat-pipeline-service/static-checks:$(params.target_branch)
99
99
script : |
100
100
#!/usr/bin/env bash
101
- /opt/ static-checks/bin/hadolint.sh --workspace_dir $(workspaces.source.path)
101
+ $(workspaces.source.path)/ci/images/ static-checks/content/ bin/hadolint.sh --config-file $(workspaces.source.path)/ci/images/static-checks/content/config/hadolint.yaml --workspace_dir $(workspaces.source.path)
102
102
workspaces :
103
103
- name : source
104
104
- name : checkov
Original file line number Diff line number Diff line change @@ -33,12 +33,15 @@ usage() {
33
33
Usage:
34
34
${0##*/ } [options]
35
35
36
- Run yamllint in the content of the workspace directory
36
+ Run hadolint in the content of the workspace directory
37
37
38
38
Optional arguments:
39
39
-w, --workspace_dir WORKSPACE_DIR.
40
40
Workspace directory.
41
41
Default: $PROJECT_DIR
42
+ -c, --config-file CONFIG_FILE
43
+ Configuration file.
44
+ Default: the path '../config/hadolint.yaml' from this script
42
45
-d, --debug
43
46
Activate tracing/debug mode.
44
47
-h, --help
@@ -51,6 +54,7 @@ Example:
51
54
52
55
parse_args () {
53
56
WORKSPACE_DIR=" $PROJECT_DIR "
57
+ CONFIG_FILE=" $SCRIPT_DIR /../config/hadolint.yaml"
54
58
while [[ $# -gt 0 ]]; do
55
59
case $1 in
56
60
-w | --workspace_dir)
@@ -66,6 +70,10 @@ parse_args() {
66
70
usage
67
71
exit 0
68
72
;;
73
+ -c | --config-file)
74
+ shift
75
+ CONFIG_FILE=" $1 "
76
+ ;;
69
77
* )
70
78
echo " [ERROR] Unknown argument: $1 " >&2
71
79
usage
@@ -82,7 +90,7 @@ init() {
82
90
83
91
run () {
84
92
find " $WORKSPACE_DIR " -name Dockerfile -exec \
85
- hadolint -c " $SCRIPT_DIR /../config/hadolint.yaml " {} +
93
+ hadolint -c " $CONFIG_FILE " {} +
86
94
}
87
95
88
96
main () {
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ Optional arguments:
39
39
-w, --workspace_dir WORKSPACE_DIR.
40
40
Workspace directory.
41
41
Default: $PROJECT_DIR
42
+ -c, --config-file CONFIG_FILE
43
+ Configuration file.
44
+ Default: the path '../config/yamllint.yaml' from this script
42
45
-d, --debug
43
46
Activate tracing/debug mode.
44
47
-h, --help
@@ -51,6 +54,7 @@ Example:
51
54
52
55
parse_args () {
53
56
WORKSPACE_DIR=" $PROJECT_DIR "
57
+ CONFIG_FILE=" $SCRIPT_DIR /../config/yamllint.yaml"
54
58
while [[ $# -gt 0 ]]; do
55
59
case $1 in
56
60
-w | --workspace_dir)
@@ -66,6 +70,10 @@ parse_args() {
66
70
usage
67
71
exit 0
68
72
;;
73
+ -c | --config-file)
74
+ shift
75
+ CONFIG_FILE=" $1 "
76
+ ;;
69
77
* )
70
78
echo " [ERROR] Unknown argument: $1 " >&2
71
79
usage
@@ -81,7 +89,7 @@ init() {
81
89
}
82
90
83
91
run () {
84
- yamllint -c " $SCRIPT_DIR /../config/yamllint.yaml " " $WORKSPACE_DIR "
92
+ yamllint -c " $CONFIG_FILE " " $WORKSPACE_DIR "
85
93
}
86
94
87
95
main () {
You can’t perform that action at this time.
0 commit comments