mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 07:04:37 +02:00
Merge pull request #8791 from Icinga/feature/gha211
GitHub actions: build packages
This commit is contained in:
commit
c6cf9c6279
289
.github/workflows/packages.yml
vendored
Normal file
289
.github/workflows/packages.yml
vendored
Normal file
@ -0,0 +1,289 @@
|
|||||||
|
name: Packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- 'support/*'
|
||||||
|
pull_request: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deb:
|
||||||
|
name: .deb
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
distro:
|
||||||
|
- name: debian
|
||||||
|
codename: buster
|
||||||
|
has32bit: true
|
||||||
|
- name: debian
|
||||||
|
codename: stretch
|
||||||
|
has32bit: true
|
||||||
|
- name: ubuntu
|
||||||
|
codename: hirsute
|
||||||
|
has32bit: false
|
||||||
|
- name: ubuntu
|
||||||
|
codename: groovy
|
||||||
|
has32bit: false
|
||||||
|
- name: ubuntu
|
||||||
|
codename: focal
|
||||||
|
has32bit: false
|
||||||
|
- name: ubuntu
|
||||||
|
codename: bionic
|
||||||
|
has32bit: true
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout HEAD
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: deb-icinga2
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
git clone https://git.icinga.com/packaging/deb-icinga2.git
|
||||||
|
chmod o+w deb-icinga2
|
||||||
|
|
||||||
|
- name: Source
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
git checkout -B master
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
|
||||||
|
-v "$(pwd)/.git:/icinga2.git:ro" \
|
||||||
|
-w /deb-icinga2 \
|
||||||
|
-e ICINGA_BUILD_PROJECT=icinga2 \
|
||||||
|
-e ICINGA_BUILD_TYPE=snapshot \
|
||||||
|
-e UPSTREAM_GIT_URL=file:///icinga2.git \
|
||||||
|
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.codename }} \
|
||||||
|
icinga-build-deb-source
|
||||||
|
|
||||||
|
- name: Restore/backup ccache
|
||||||
|
id: ccache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: deb-icinga2/ccache
|
||||||
|
key: |-
|
||||||
|
${{ matrix.distro.name }}/${{ matrix.distro.codename }}-ccache-${{ hashFiles('deb-icinga2/ccache') }}
|
||||||
|
|
||||||
|
- name: Binary x64
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
if [ -e deb-icinga2/ccache ]; then
|
||||||
|
chmod -R o+w deb-icinga2/ccache
|
||||||
|
fi
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
|
||||||
|
-w /deb-icinga2 \
|
||||||
|
-e ICINGA_BUILD_PROJECT=icinga2 \
|
||||||
|
-e ICINGA_BUILD_TYPE=snapshot \
|
||||||
|
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.codename }} \
|
||||||
|
icinga-build-deb-binary
|
||||||
|
|
||||||
|
- name: Binary x86
|
||||||
|
if: matrix.distro.has32bit
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
|
||||||
|
-w /deb-icinga2 \
|
||||||
|
-e ICINGA_BUILD_PROJECT=icinga2 \
|
||||||
|
-e ICINGA_BUILD_TYPE=snapshot \
|
||||||
|
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.codename }}:x86 \
|
||||||
|
icinga-build-deb-binary
|
||||||
|
|
||||||
|
- name: Test x64
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
|
||||||
|
-w /deb-icinga2 \
|
||||||
|
-e ICINGA_BUILD_PROJECT=icinga2 \
|
||||||
|
-e ICINGA_BUILD_TYPE=snapshot \
|
||||||
|
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.codename }} \
|
||||||
|
icinga-build-test
|
||||||
|
|
||||||
|
- name: Test x86
|
||||||
|
if: matrix.distro.has32bit
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
|
||||||
|
-w /deb-icinga2 \
|
||||||
|
-e ICINGA_BUILD_PROJECT=icinga2 \
|
||||||
|
-e ICINGA_BUILD_TYPE=snapshot \
|
||||||
|
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.codename }}:x86 \
|
||||||
|
icinga-build-test
|
||||||
|
rpm:
|
||||||
|
name: .rpm
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
distro:
|
||||||
|
- name: centos
|
||||||
|
release: 8
|
||||||
|
- name: centos
|
||||||
|
release: 7
|
||||||
|
- name: fedora
|
||||||
|
release: 34
|
||||||
|
- name: fedora
|
||||||
|
release: 33
|
||||||
|
- name: sles
|
||||||
|
release: '15.2'
|
||||||
|
- name: sles
|
||||||
|
release: '12.5'
|
||||||
|
- name: opensuse
|
||||||
|
release: '15.2'
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Vars
|
||||||
|
id: vars
|
||||||
|
env:
|
||||||
|
GITLAB_REGISTRY_RO_TOKEN: '${{ secrets.GITLAB_REGISTRY_RO_TOKEN }}'
|
||||||
|
run: |
|
||||||
|
if [ '${{ matrix.distro.name }}' = sles ]; then
|
||||||
|
if [ "$(tr -d '\n' <<<"$GITLAB_REGISTRY_RO_TOKEN" |wc -c)" -eq 0 ]; then
|
||||||
|
echo '::set-output name=CAN_BUILD::false'
|
||||||
|
echo '::set-output name=NEED_LOGIN::false'
|
||||||
|
else
|
||||||
|
echo '::set-output name=CAN_BUILD::true'
|
||||||
|
echo '::set-output name=NEED_LOGIN::true'
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo '::set-output name=CAN_BUILD::true'
|
||||||
|
echo '::set-output name=NEED_LOGIN::false'
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Checkout HEAD
|
||||||
|
if: "steps.vars.outputs.CAN_BUILD == 'true'"
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Login
|
||||||
|
if: "steps.vars.outputs.NEED_LOGIN == 'true'"
|
||||||
|
env:
|
||||||
|
GITLAB_REGISTRY_RO_TOKEN: '${{ secrets.GITLAB_REGISTRY_RO_TOKEN }}'
|
||||||
|
run: |
|
||||||
|
docker login registry.icinga.com -u build-docker/sles --password-stdin <<<"$GITLAB_REGISTRY_RO_TOKEN"
|
||||||
|
|
||||||
|
- name: rpm-icinga2
|
||||||
|
if: "steps.vars.outputs.CAN_BUILD == 'true'"
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
git clone https://git.icinga.com/packaging/rpm-icinga2.git
|
||||||
|
chmod o+w rpm-icinga2
|
||||||
|
|
||||||
|
- name: Restore/backup ccache
|
||||||
|
if: "steps.vars.outputs.CAN_BUILD == 'true'"
|
||||||
|
id: ccache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: rpm-icinga2/ccache
|
||||||
|
key: |-
|
||||||
|
${{ matrix.distro.name }}/${{ matrix.distro.release }}-ccache-${{ hashFiles('rpm-icinga2/ccache') }}
|
||||||
|
|
||||||
|
- name: Binary
|
||||||
|
if: "steps.vars.outputs.CAN_BUILD == 'true'"
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
git checkout -B master
|
||||||
|
if [ -e rpm-icinga2/ccache ]; then
|
||||||
|
chmod -R o+w rpm-icinga2/ccache
|
||||||
|
fi
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/rpm-icinga2:/rpm-icinga2" \
|
||||||
|
-v "$(pwd)/.git:/icinga2.git:ro" \
|
||||||
|
-w /rpm-icinga2 \
|
||||||
|
-e ICINGA_BUILD_PROJECT=icinga2 \
|
||||||
|
-e ICINGA_BUILD_TYPE=snapshot \
|
||||||
|
-e UPSTREAM_GIT_URL=file:///icinga2.git \
|
||||||
|
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.release }} \
|
||||||
|
icinga-build-package
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
if: "steps.vars.outputs.CAN_BUILD == 'true'"
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/rpm-icinga2:/rpm-icinga2" \
|
||||||
|
-w /rpm-icinga2 \
|
||||||
|
-e ICINGA_BUILD_PROJECT=icinga2 \
|
||||||
|
-e ICINGA_BUILD_TYPE=snapshot \
|
||||||
|
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.release }} \
|
||||||
|
icinga-build-test
|
||||||
|
raspbian:
|
||||||
|
name: Raspbian
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
codename:
|
||||||
|
- buster
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout HEAD
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: qemu-user-static
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
sudo apt-get update
|
||||||
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y qemu-user-static
|
||||||
|
|
||||||
|
- name: raspbian-icinga2
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
git clone https://git.icinga.com/packaging/raspbian-icinga2.git
|
||||||
|
chmod o+w raspbian-icinga2
|
||||||
|
|
||||||
|
- name: Restore/backup ccache
|
||||||
|
id: ccache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: raspbian-icinga2/ccache
|
||||||
|
key: |-
|
||||||
|
raspbian/${{ matrix.codename }}-ccache-${{ hashFiles('raspbian-icinga2/ccache') }}
|
||||||
|
|
||||||
|
- name: Binary
|
||||||
|
run: |
|
||||||
|
set -exo pipefail
|
||||||
|
git checkout -B master
|
||||||
|
if [ -e raspbian-icinga2/ccache ]; then
|
||||||
|
chmod -R o+w raspbian-icinga2/ccache
|
||||||
|
fi
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/raspbian-icinga2:/raspbian-icinga2" \
|
||||||
|
-v "$(pwd)/.git:/icinga2.git:ro" \
|
||||||
|
-w /raspbian-icinga2 \
|
||||||
|
-e ICINGA_BUILD_PROJECT=icinga2 \
|
||||||
|
-e ICINGA_BUILD_TYPE=snapshot \
|
||||||
|
-e UPSTREAM_GIT_URL=file:///icinga2.git \
|
||||||
|
-e ICINGA_BUILD_DEB_DEFAULT_ARCH=armhf \
|
||||||
|
registry.icinga.com/build-docker/raspbian/${{ matrix.codename }} \
|
||||||
|
icinga-build-package
|
||||||
|
|
||||||
|
# Setting up icinga2-bin (2.12.0+rc1.25.g5d1c82a3d.20200526.0754+buster-0) ...
|
||||||
|
# enabling default icinga2 features
|
||||||
|
# qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6015c75c
|
||||||
|
# qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6015c75c
|
||||||
|
# qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x600016ea
|
||||||
|
# dpkg: error processing package icinga2-bin (--configure):
|
||||||
|
# installed icinga2-bin package post-installation script subprocess returned error exit status 127
|
||||||
|
#
|
||||||
|
# - name: Test
|
||||||
|
# run: |
|
||||||
|
# set -exo pipefail
|
||||||
|
# docker run --rm \
|
||||||
|
# -v "$(pwd)/raspbian-icinga2:/raspbian-icinga2" \
|
||||||
|
# -w /raspbian-icinga2 \
|
||||||
|
# -e ICINGA_BUILD_PROJECT=icinga2 \
|
||||||
|
# -e ICINGA_BUILD_TYPE=snapshot \
|
||||||
|
# -e ICINGA_BUILD_DEB_DEFAULT_ARCH=armhf \
|
||||||
|
# registry.icinga.com/build-docker/raspbian/${{ matrix.codename }} \
|
||||||
|
# icinga-build-test
|
42
.travis.yml
42
.travis.yml
@ -1,42 +0,0 @@
|
|||||||
dist: xenial
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
language: cpp
|
|
||||||
|
|
||||||
cache: ccache
|
|
||||||
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- sourceline: 'deb http://packages.icinga.com/ubuntu icinga-xenial main'
|
|
||||||
key_url: 'https://packages.icinga.com/icinga.key'
|
|
||||||
packages:
|
|
||||||
- libboost1.67-icinga-all-dev
|
|
||||||
- flex
|
|
||||||
- bison
|
|
||||||
- libssl-dev
|
|
||||||
- libpq-dev
|
|
||||||
- libmysqlclient-dev
|
|
||||||
- libedit-dev
|
|
||||||
before_script:
|
|
||||||
- arch=$(uname -m)
|
|
||||||
- mkdir build
|
|
||||||
- cd build
|
|
||||||
- >
|
|
||||||
cmake ..
|
|
||||||
-DCMAKE_BUILD_TYPE=Debug
|
|
||||||
-DICINGA2_UNITY_BUILD=Off
|
|
||||||
-DCMAKE_INSTALL_PREFIX=/tmp/icinga2
|
|
||||||
-DICINGA2_PLUGINDIR=/tmp/icinga2/sbin
|
|
||||||
-DBoost_NO_BOOST_CMAKE=TRUE
|
|
||||||
-DBoost_NO_SYSTEM_PATHS=TRUE
|
|
||||||
-DBOOST_LIBRARYDIR=/usr/lib/${arch}-linux-gnu/icinga-boost
|
|
||||||
-DBOOST_INCLUDEDIR=/usr/include/icinga-boost
|
|
||||||
-DCMAKE_INSTALL_RPATH=/usr/lib/${arch}-linux-gnu/icinga-boost
|
|
||||||
|
|
||||||
script:
|
|
||||||
- make
|
|
||||||
- make test
|
|
||||||
- make install
|
|
||||||
- /tmp/icinga2/sbin/icinga2 --version
|
|
||||||
- /tmp/icinga2/sbin/icinga2 daemon -C -DRunAsUser=$(id -u -n) -DRunAsGroup=$(id -g -n)
|
|
Loading…
x
Reference in New Issue
Block a user