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

Add GitLab scanning, linting

parent 34facc21
Branches
No related tags found
1 merge request!4Add GitLab scanning, linting
#!/bin/bash
jq --null-input --arg yaml "$1" '.content=$yaml' \
| curl "https://git.ethitter.com/api/v4/ci/lint?include_merged_yaml=true" \
--silent \
--header 'Content-Type: application/json' \
--header "PRIVATE-TOKEN: $GITLAB_API_PAT" \
--data @- \
-o result.json
echo "**********************************************************"
echo "MERGED YAML:"
jq --raw-output '.merged_yaml' < result.json
echo "**********************************************************"
echo "ERRORS:"
jq '.errors' < result.json
echo "**********************************************************"
echo "WARNINGS:"
jq '.warnings' < result.json
echo "**********************************************************"
echo "IS VALID:"
jq '.valid' < result.json
if [ "$(jq '.valid' < result.json)" = "true" ]; then
exit 0
else
exit 1
fi
.idea
*.iml
result.json
before_script:
- |
apt-get update
apt-get -y --no-install-recommends install jq
apt-get clean
rm -rf /var/lib/apt/lists/*
lint:
stage: test
image: containers.ethitter.com:443/docker/images/debian:bullseye
script:
- sh ./.ci-scripts/lint.sh "$(<./plugins/default.yml)"
include:
- remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/stages.yml
- remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/image.yml
- remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/variables.yml
- remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/cache.yml
- remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/stages.yml
- remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/before-script.yml
- remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/matrix.yml
- remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/gitlab-tools.yml
include:
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/License-Scanning.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
dependency_scanning:
before_script: echo ""
stage: security
license_scanning:
before_script: echo ""
stage: security
sast:
before_script: echo ""
stage: security
secret_detection:
before_script: echo ""
stage: security
stages:
- test
- .pre
- build
- test
- security
- deploy
- .post
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment