summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Schenker <philippe.schenker@toradex.com>2021-02-19 10:04:17 +0100
committerPhilippe Schenker <philippe.schenker@toradex.com>2021-02-19 10:11:26 +0100
commitf54619d1667d9cc1741419ed83c5f5c124d4604d (patch)
tree9a5216eaba598d14bdb5db7333f66710ef3223af
parent6b9a21c20f7fb2fa5c32084228414992a4bccb36 (diff)
Add license checking in CI
-rw-r--r--.gitlab-ci.yml36
1 files changed, 18 insertions, 18 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0e70af0..a4b2919 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,22 +1,22 @@
-variables:
-# uncomment for the pipeline debug purpose
- CI_DEBUG_TRACE: "true"
- CI_IMAGE: gitlab.int.toradex.com:4567/philippe.schenker/linux-toradex/ci-kernel-builder:gcc9
- DOCKER_HOST: tcp://docker:2375
- DOCKER_DRIVER: overlay2
- DOCKER_TLS_CERTDIR: ""
-
stages:
- - empty-stub
+ - check-license
-prepare_kernel:
- stage: empty-stub
- image: $CI_IMAGE
+check-license_job:
+ stage: check-license
variables:
- GIT_STRATEGY: fetch
- GIT_DEPTH: "1"
- script: |
- echo "Just return true. For now it is too tough to implement a real overlay checking."
- echo "It depends on possibly unmerged changes in the corresponding branch of linux kernel."
- true
+ EXPECTED_LIC_STR: "SPDX-License-Identifier: GPL-2.0-or-later OR MIT"
+ script:
+ - cd $CI_PROJECT_DIR/overlays
+ - |
+ for DTO in $(ls *dts)
+ do
+ head -n 1 $DTO | \
+ grep -q "${EXPECTED_LIC_STR}" || \
+ ERRMSG="${ERRMSG}License mssing, wrong or not on 1st line: ${DTO} \n"
+ done
+ if [ "${ERRMSG}" ]
+ then
+ echo -ne $ERRMSG
+ exit -1
+ fi