.gitlab-ci.yml: check for dco

This commit is contained in:
Adhityaa Chandrasekar 2018-08-13 00:10:33 +05:30
parent 999ba0c419
commit e95e2f9e7a
2 changed files with 23 additions and 0 deletions

View File

@ -1,10 +1,21 @@
stages: stages:
- check-dco
- go-fmt - go-fmt
- build-src - build-src
- build-docker - build-docker
- go-test - go-test
- docker-registry - docker-registry
check-dco:
stage: check-dco
image: debian:buster
except:
- master
script:
- apt update
- apt install -y curl git jq
- bash ./scripts/check-dco
build-src: build-src:
stage: build-src stage: build-src
image: debian:buster image: debian:buster

12
scripts/check-dco Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
emails=$(git log master..HEAD --pretty=format:'%ae' | sort | uniq)
for email in $emails; do
printf "checking %s\n" "$email"
if ! curl -s 'https://dco.commento.io/api/has-signed' -d "email=$email" -X POST \
| jq '.hasSigned' \
| grep -q true; then
printf "%s has not signed the DCO: https://dco.commento.io\n" "$email"
exit 1
fi
done