Use dedicated script
This commit is contained in:
parent
f8566e91a6
commit
6aa9b023f0
2 changed files with 23 additions and 20 deletions
|
@ -48,26 +48,7 @@ check-changelog:
|
||||||
after_script: ''
|
after_script: ''
|
||||||
cache: {}
|
cache: {}
|
||||||
script:
|
script:
|
||||||
- echo $CI_MERGE_REQUEST_IID
|
- sh ./tools/check-changelog
|
||||||
- >
|
|
||||||
ls changelog.d
|
|
||||||
count=0
|
|
||||||
for i in add remove fix security skip; do
|
|
||||||
[ -f changelog.d/"$CI_MERGE_REQUEST_IID"."$i" ]
|
|
||||||
retcode=$?
|
|
||||||
if [ $retcode -eq 0 ]; then
|
|
||||||
echo "found $CI_MERGE_REQUEST_IID.$i"
|
|
||||||
else
|
|
||||||
echo "no $CI_MERGE_REQUEST_IID.$i"
|
|
||||||
fi
|
|
||||||
count=$(( $count + 1 - $retcode ))
|
|
||||||
done
|
|
||||||
if [ $count -eq 1 ]; then
|
|
||||||
echo "ok"
|
|
||||||
else
|
|
||||||
echo "must have a changelog entry or explicitly skip it"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
|
22
tools/check-changelog
Normal file
22
tools/check-changelog
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo $CI_MERGE_REQUEST_IID
|
||||||
|
ls changelog.d
|
||||||
|
count=0
|
||||||
|
for i in add remove fix security skip; do
|
||||||
|
[ -f changelog.d/"$CI_MERGE_REQUEST_IID"."$i" ]
|
||||||
|
retcode=$?
|
||||||
|
if [ $retcode -eq 0 ]; then
|
||||||
|
echo "found $CI_MERGE_REQUEST_IID.$i"
|
||||||
|
else
|
||||||
|
echo "no $CI_MERGE_REQUEST_IID.$i"
|
||||||
|
fi
|
||||||
|
count=$(( $count + 1 - $retcode ))
|
||||||
|
done
|
||||||
|
if [ $count -eq 1 ]; then
|
||||||
|
echo "ok"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "must have a changelog entry or explicitly skip it"
|
||||||
|
exit 1
|
||||||
|
fi
|
Loading…
Reference in a new issue