Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wordpress
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitLab
CI
wordpress
Commits
5517facd
Commit
5517facd
authored
2 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
DRY
parent
2c35b090
No related branches found
Branches containing commit
No related tags found
1 merge request
!23
Test linting for configurations
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.ci-scripts/lint.sh
+17
-0
17 additions, 0 deletions
.ci-scripts/lint.sh
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
.gitlab-ci.yml
+8
-7
8 additions, 7 deletions
.gitlab-ci.yml
with
27 additions
and
7 deletions
.ci-scripts/lint.sh
0 → 100644
+
17
−
0
View file @
5517facd
#!/bin/bash
jq
--null-input
--arg
yaml
"
$1
"
'.content=$yaml'
\
| curl
-vvv
"https://git.ethitter.com/api/v4/ci/lint?include_merged_yaml=true"
\
--header
'Content-Type: application/json'
\
--header
"PRIVATE-TOKEN:
$GITLAB_API_PAT
"
\
--data
@-
-o
result.json
jq
--raw-output
'.merged_yaml'
< result.json
jq
'.errors'
< result.json
jq
'.warnings'
< result.json
if
[[
true
==
$(
jq
'.valid'
< result.json
)
]]
;
then
exit
0
else
exit
1
fi
This diff is collapsed.
Click to expand it.
.gitignore
+
2
−
0
View file @
5517facd
.idea
.idea
*.iml
*.iml
result.json
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
8
−
7
View file @
5517facd
...
@@ -5,13 +5,14 @@ before_script:
...
@@ -5,13 +5,14 @@ before_script:
apt-get clean
apt-get clean
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/*
L
int:plugins:default
:
l
int:plugins:default
:
stage
:
test
stage
:
test
image
:
containers.ethitter.com:443/docker/images/debian:bullseye
image
:
containers.ethitter.com:443/docker/images/debian:bullseye
script
:
script
:
-
|
-
sh ./.ci-scripts/lint.sh "$(<./plugins/default.yml)"
jq --null-input --arg yaml "$(<./plugins/default.yml)" '.content=$yaml' \
| curl "https://git.ethitter.com/api/v4/ci/lint?include_merged_yaml=true" \
lint:plugins:default-redis
:
--header 'Content-Type: application/json' \
stage
:
test
--header "PRIVATE-TOKEN: $GITLAB_API_PAT" \
image
:
containers.ethitter.com:443/docker/images/debian:bullseye
--data @-
script
:
-
sh ./.ci-scripts/lint.sh "$(<./plugins/default-redis.yml)"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment