Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNM: DCO testing #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
- job:
name: dco-license-check
run: playbooks/dco/run.yaml

- project:
templates:
- build-tox-docs
check:
jobs:
- dco-license-check
post:
jobs:
- tox-docs
33 changes: 33 additions & 0 deletions playbooks/dco/run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
- hosts: all

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tasks:
- name: Developer Certificate of Origin (DCO) license check
shell:
cmd: |
set -e
result=0
for commit in $(git cherry -v origin/{{ zuul.branch }} HEAD | cut -d " " -f2)
do
if ! git show -s $commit | grep -q "Signed-off-by:"; then
echo "---"
git show -s $commit
echo "---"
echo "does not have a Signed-off-by header"
result=1
fi
done
exit $result
chdir: "{{ zuul.project.src_dir }}"
executable: /bin/bash
register: _dco
failed_when: _dco.rc > 1

- name: License check failed
fail:
msg: |
One or more commits have not been signed properly using --signoff.

The meaning of a signoff depends on the project, but it typically
certifies that committer has the rights to submit this work under
the same license and agrees to a Developer Certificate of Origin
(see http://developercertificate.org/ for more information).
when: _dco.rc != 0
1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
new line
b