mirror of https://gitlab.com/pamhyr/pamhyr2
ci: Add antivirus check with clamav scan.
parent
21e97d4e30
commit
d541becb1a
|
|
@ -20,6 +20,7 @@ stages:
|
|||
- test
|
||||
- build
|
||||
- package
|
||||
- antivirus
|
||||
- release
|
||||
|
||||
#############
|
||||
|
|
@ -403,6 +404,25 @@ windows-package-exe:
|
|||
- copy ..\packages\pamhyr.nsi pamhyr.nsi
|
||||
- .\make-windows-exe.bat
|
||||
|
||||
pkg-check-clamav:
|
||||
stage: antivirus
|
||||
tags:
|
||||
- release
|
||||
- linux
|
||||
needs:
|
||||
- job: linux-package-tar
|
||||
artifacts: true
|
||||
- job: windows-package-zip
|
||||
artifacts: true
|
||||
- job: windows-package-exe
|
||||
artifacts: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == 'ci-test' || $CI_COMMIT_TAG
|
||||
script:
|
||||
- cd packages
|
||||
- ./clamav-scan.sh
|
||||
allow_failure: true
|
||||
|
||||
###########
|
||||
# RELEASE #
|
||||
###########
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
#! /bin/bash
|
||||
set +x
|
||||
|
||||
OPTS="-r -a"
|
||||
FILES="../windows/pamhyr-windows.exe ../windows/pamhyr-windows.zip ../linux/pamhyr-gnulinux.tar.xz"
|
||||
|
||||
clamscan $OPTS $FILES | tee clamav.log
|
||||
|
||||
RES=$(cat clamav.log | grep "Infected files: 0")
|
||||
if [ -z "$RES" ]; then
|
||||
echo "Infected files"
|
||||
exit -1
|
||||
else
|
||||
echo "OK"
|
||||
exit 0
|
||||
fi
|
||||
Loading…
Reference in New Issue