...
 
Commits (2)
.build_job: &job_build
.build_job:
stage: build
script:
- apt-get update && apt-get -y dist-upgrade
# Workaround for bionic
- DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata
- ci-build-pkg
artifacts:
expire_in: 1 hour
paths:
- result/*
except:
variables:
- $SONARJOB == "1"
.debian_build_job:
extends: .build_job
script:
- apt-get update && apt-get -y dist-upgrade
- DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata
- ci-build-pkg
before_script:
- env | grep ^CI_
# Converting to native package...
- sed -i "1{s/-1) /$suffix) /}" debian/changelog
- sed -i "1{s/-2) /$suffix) /}" debian/changelog
- sed -i 's/3.0 (quilt)/3.0 (native)/' debian/source/format
stages:
- build
......@@ -18,53 +28,42 @@ stages:
before_script:
- env | grep ^CI_
# Converting to native package...
- sed -i "1{s/-1) /$suffix) /}" debian/changelog
- sed -i "1{s/-2) /$suffix) /}" debian/changelog
- sed -i 's/3.0 (quilt)/3.0 (native)/' debian/source/format
build_stretch:
extends: .debian_build_job
image: buildpkg/debian:stretch
<<: *job_build
build_buster:
extends: .debian_build_job
image: buildpkg/debian:buster
<<: *job_build
#build_xenial:
# extends: .debian_build_job
# image: buildpkg/ubuntu:xenial
# <<: *job_build
build_bionic:
extends: .debian_build_job
image: buildpkg/ubuntu:bionic
<<: *job_build
build_centos_7:
extends: .build_job
image: buildpkg/centos:7
stage: build
script:
- rm -f /etc/yum.repos.d/CentOS-Sources.repo
- yum -y install epel-release
- make rpm-dist
- ci-build-pkg
artifacts:
expire_in: 1 day
paths:
- result/*
build_centos_8:
extends: .build_job
image: buildpkg/centos:8
stage: build
script:
- yum-config-manager --enable PowerTools
- yum-config-manager --enable AppStream
- yum -y install epel-release
- make rpm-dist
- ci-build-pkg
artifacts:
expire_in: 1 day
paths:
- result/*
sign:
image: buildpkg/debian:stretch
......@@ -113,3 +112,25 @@ pages:
only:
- master
sonar-inspect:
image: buildpkg/debian:buster
stage: build
script:
- scripts/sonar
artifacts:
expire_in: 1 hour
paths:
- lemonldap-ng-*/cover_db/sonar_generic.xml
- lemonldap-ng-*/perlcritic_report.txt
only:
variables:
- $SONARJOB == "1"
sonar-upload:
stage: deploy
image: sonarsource/sonar-scanner-cli
script:
- sonar-scanner
only:
variables:
- $SONARJOB == "1"
#!/bin/sh
mk-build-deps --install --remove \
--tool "apt-get -o Debug::pkgProblemResolver=yes -q -y" \
debian/control
apt -y install libperl-critic-perl libdevel-cover-perl cpanminus
cpanm install Devel::Cover::Report::SonarGeneric
make SKIP_DOCUMENTATION=1
for module in common handler portal manager; do
cd lemonldap-ng-$module
perlcritic --cruel --quiet --verbose "%f~|~%s~|~%l~|~%c~|~%m~|~%e~|~%p~||~%n" lib t > perlcritic_report.txt
cover -delete
HARNESS_PERL_SWITCHES=-MDevel::Cover prove
cover -report SonarGeneric
sed -i "s,path=\"blib,path=\"lemonldap-ng-$module,g" cover_db/sonar_generic.xml
cd ..
done
# must be unique in a given SonarQube instance
# this is the name displayed in the SonarQube UI
sonar.projectName=LemonLDAP::NG
sonar.projectKey=lemonldap-ng
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
sonar.sources=lib
sonar.tests=t
sonar.modules=lemonldap-ng-common,lemonldap-ng-handler,lemonldap-ng-portal,lemonldap-ng-manager
lemonldap-ng-common.sonar.perlcritic.reportPath=lemonldap-ng-common/perlcritic_report.txt
lemonldap-ng-handler.sonar.perlcritic.reportPath=lemonldap-ng-handler/perlcritic_report.txt
lemonldap-ng-portal.sonar.perlcritic.reportPath=lemonldap-ng-portal/perlcritic_report.txt
lemonldap-ng-manager.sonar.perlcritic.reportPath=lemonldap-ng-manager/perlcritic_report.txt
# requires manually fixing file paths in each coverage file
sonar.coverageReportPaths=lemonldap-ng-common/cover_db/sonar_generic.xml,lemonldap-ng-handler/cover_db/sonar_generic.xml,lemonldap-ng-portal/cover_db/sonar_generic.xml,lemonldap-ng-manager/cover_db/sonar_generic.xml