Skip to content
Snippets Groups Projects
Commit 5517facd authored by Erick Hitter's avatar Erick Hitter
Browse files

DRY

parent 2c35b090
No related branches found
No related tags found
1 merge request!23Test linting for configurations
#!/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
.idea .idea
*.iml *.iml
result.json
...@@ -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/*
Lint:plugins:default: lint: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)"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment