firejail/.gitlab-ci.yml
Fred Barclay 2e14c1a1d0
Adding sort.py to GitLab CI (#2973)
* Add contrib/sort.py to Gitlab CI

Not adding to Debian Jessie or CentOS since python >=3.6 is not
available

See https://github.com/netblue30/firejail/pull/2870

* Updates

Explicitly install python3 on Ubuntu (should be pre-installed but not
working as-is)

Remove running python3 code on CentOS

* ci: comment out contrib/sort.py for Alpine

Getting this error:
$ python3 contrib/sort.py etc/*.{profile,inc}
[ Error ] Can't find `etc/*.{profile,inc}'
ERROR: Job failed: exit code 1

For now it's better to debug later and enable this test for the other
jobs
2019-09-21 10:19:38 -05:00

83 lines
3.5 KiB
YAML

# Basic notes: builds firejail on 5 different systems for 2 package systems:
# 1. Debian-based systems. Use debian:jessie to ensure reasonable backwards
# compat and ubuntu:rolling for new setups
# 2. Redhat-based systems. Use centos:latest for reasonable backwards compat
# and fedora:latest for new setups
# 3. Alpine for installing directly from source
# Also builds apparmor package for Ubuntu LTS
build_ubuntu_package:
image: ubuntu:rolling
script:
- apt-get update -qq
- apt-get install -y -qq build-essential lintian pkg-config python3
- ./configure --prefix=/usr && make deb && dpkg -i firejail*.deb
- python3 contrib/sort.py etc/*.{profile,inc}
build_debian_package:
image: debian:jessie
script:
- apt-get update -qq
- apt-get install -y -qq build-essential lintian pkg-config
- ./configure --prefix=/usr && make deb && dpkg -i firejail*.deb
build_redhat_package:
image: centos:latest
script:
- yum update -y
- yum install -y rpm-build gcc make
- ./configure --prefix=/usr && make rpms && yum install -y firejail*.rpm
build_fedora_package:
image: fedora:latest
script:
- dnf update -y
- dnf install -y rpm-build gcc make
- ./configure --prefix=/usr && make rpms && rpm -i firejail*.rpm
- python3 contrib/sort.py etc/*.{profile,inc}
build_src_package:
image: alpine:latest
script:
- apk update
- apk upgrade
- apk add build-base linux-headers python3
- ./configure --prefix=/usr && make && make install-strip
# - python3 contrib/sort.py etc/*.{profile,inc}
build_apparmor:
image: ubuntu:latest
script:
- apt-get update -qq
- apt-get install -y -qq build-essential lintian libapparmor-dev pkg-config
- ./configure --prefix=/usr && make deb-apparmor && dpkg -i firejail-apparmor*.deb
cppcheck:
image: debian:latest
before_script:
- apt-get -qq update
- apt-get -qq --no-install-recommends install cppcheck
script:
- cppcheck -q --force --error-exitcode=1 --enable=warning,performance .
debian_ci:
image: registry.salsa.debian.org/salsa-ci-team/ci-image-git-buildpackage:latest
variables:
DEBFULLNAME: "$GITLAB_USER_NAME"
DEBEMAIL: "$GITLAB_USER_EMAIL"
before_script:
- git checkout -B ci_build $CI_COMMIT_SHA
- gitlab-ci-enable-sid
- gitlab-ci-enable-experimental
- echo "deb-src http://deb.debian.org/debian sid main" >> /etc/apt/sources.list
- echo "deb-src http://deb.debian.org/debian experimental main" >> /etc/apt/sources.list
- apt-get update
- git config user.email "$GITLAB_USER_NAME" && git config user.name "$GITLAB_USER_EMAIL"
- cd $CI_PROJECT_DIR/.. && (apt-get source --download-only -t experimental firejail || apt-get source --download-only firejail)
- cd $CI_PROJECT_DIR && tar xf ../firejail_*.debian.tar.*
- VERSION=$(grep ^PACKAGE_VERSION= configure | cut -d"'" -f2) && dch -v ${VERSION}-0.1~ci "Non-maintainer upload." && git archive -o ../firejail_${VERSION}.orig.tar.gz HEAD && pristine-tar commit ../firejail_${VERSION}.orig.tar.gz ci_build && git branch -m pristine-tar origin/pristine-tar
- git add debian && git commit -m "add debian/"
- export CI_COMMIT_SHA=$(git rev-parse HEAD)
script:
- apt-get --no-install-recommends install pkg-config
- gitlab-ci-git-buildpackage
- gitlab-ci-lintian