From b754dd0bbc53ac36c3ea7d18cddbdd4a265e4bf2 Mon Sep 17 00:00:00 2001 From: Luiz Costa Date: Tue, 12 Apr 2022 13:33:51 +0100 Subject: [PATCH] add resources-agents from contrib repo --- connectors/vmware/Jenkinsfile | 10 ++++++ connectors/vmware/ci/debian/control | 18 ++++++++++ connectors/vmware/ci/debian/copyright | 29 +++++++++++++++ connectors/vmware/ci/debian/install | 4 +++ connectors/vmware/ci/debian/rules | 6 ++++ connectors/vmware/ci/debian/source/format | 1 + .../vmware/ci/scripts/vmware-deb-package.sh | 36 +++++++++++++++++++ 7 files changed, 104 insertions(+) create mode 100644 connectors/vmware/ci/debian/control create mode 100644 connectors/vmware/ci/debian/copyright create mode 100644 connectors/vmware/ci/debian/install create mode 100755 connectors/vmware/ci/debian/rules create mode 100644 connectors/vmware/ci/debian/source/format create mode 100755 connectors/vmware/ci/scripts/vmware-deb-package.sh diff --git a/connectors/vmware/Jenkinsfile b/connectors/vmware/Jenkinsfile index afb63d9ae..5fca635cf 100644 --- a/connectors/vmware/Jenkinsfile +++ b/connectors/vmware/Jenkinsfile @@ -35,6 +35,16 @@ try { stash name: "rpms-centos8", includes: 'output/noarch/*.rpm' sh 'rm -rf output' } + }, + 'Debian bullseye packaging and signing': { + node { + dir('centreon-vmware') { + checkout scm + } + sh 'docker run -i --entrypoint "/src/centreon-vmware/ci/scripts/vmware-deb-package.sh" -w "/src" -v "$PWD:/src" -e "DISTRIB=Debian11" -e "VERSION=$VERSION" -e "RELEASE=$RELEASE" registry.centreon.com/centreon-debian11-dependencies:22.04' + stash name: 'Debian11', includes: 'Debian11/*.deb' + archiveArtifacts artifacts: "Debian11/*" + } } if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') { error('Package stage failure.'); diff --git a/connectors/vmware/ci/debian/control b/connectors/vmware/ci/debian/control new file mode 100644 index 000000000..f14c0aad7 --- /dev/null +++ b/connectors/vmware/ci/debian/control @@ -0,0 +1,18 @@ +Source: centreon-plugin-virtualization-vmware-daemon +Section: net +Priority: optional +Maintainer: Luiz Costa +Build-Depends: debhelper-compat (= 12) +Standards-Version: 4.5.0 +Homepage: https://www.centreon.com + +Package: centreon-plugin-virtualization-vmware-daemon +Architecture: all +Depends: ${misc:Depends}, + ${shlibs:Depends}, + libio-socket-inet6-perl, + libjson-xs-perl, + liblwp-protocol-https-perl, + libzmq-constants-perl, + zmq-libzmq4-perl +Description: Perl daemon to monitor VSphere Infrastructure diff --git a/connectors/vmware/ci/debian/copyright b/connectors/vmware/ci/debian/copyright new file mode 100644 index 000000000..9d1ae47d8 --- /dev/null +++ b/connectors/vmware/ci/debian/copyright @@ -0,0 +1,29 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: centreon-plugin-virtualization-vmware-daemon +Upstream-Contact: Luiz Costa +Source: https://www.centreon.com + +Files: * +Copyright: 2022 Centreon +License: Apache-2.0 + +Files: debian/* +Copyright: 2022 Centreon +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". + diff --git a/connectors/vmware/ci/debian/install b/connectors/vmware/ci/debian/install new file mode 100644 index 000000000..b10fd273d --- /dev/null +++ b/connectors/vmware/ci/debian/install @@ -0,0 +1,4 @@ +centreon_vmware.pl usr/bin +contrib/debian/centreon_vmware-systemd lib/systemd/system/centreon_vmware +contrib/config/centreon_vmware-conf.pm etc/centreon/centreon_vmware.pm +centreon/* usr/share/perl5/centreon diff --git a/connectors/vmware/ci/debian/rules b/connectors/vmware/ci/debian/rules new file mode 100755 index 000000000..d8309f67d --- /dev/null +++ b/connectors/vmware/ci/debian/rules @@ -0,0 +1,6 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +%: + dh $@ diff --git a/connectors/vmware/ci/debian/source/format b/connectors/vmware/ci/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/connectors/vmware/ci/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/connectors/vmware/ci/scripts/vmware-deb-package.sh b/connectors/vmware/ci/scripts/vmware-deb-package.sh new file mode 100755 index 000000000..15d012602 --- /dev/null +++ b/connectors/vmware/ci/scripts/vmware-deb-package.sh @@ -0,0 +1,36 @@ +#!/bin/sh +set -ex + +if [ -z "$VERSION" -o -z "$RELEASE" -o -z "$DISTRIB" ] ; then + echo "You need to specify VERSION / RELEASE / DISTRIB variables" + exit 1 +fi + +echo "################################################## PACKAGING COLLECT ##################################################" + +AUTHOR="Luiz Costa" +AUTHOR_EMAIL="me@luizgustavo.pro.br" + +if [ -d /build ]; then + rm -rf /build +fi +mkdir -p /build +cd /build + +mkdir -p /build/centreon-plugin-virtualization-vmware-daemon +(cd /src && tar czvpf - centreon-plugin-virtualization-vmware-daemon) | dd of=centreon-plugin-virtualization-vmware-daemon-$VERSION.tar.gz +cp -rv /src/centreon-vmware /build/ +cp -rv /src/centreon-vmware/ci/debian /build/centreon-plugin-virtualization-vmware-daemon/ + +ls -lart +cd /build/centreon-plugin-virtualization-vmware-daemon +debmake -f "${AUTHOR}" -e "${AUTHOR_EMAIL}" -u "$VERSION" -y -r "$RELEASE" +debuild-pbuilder +cd /build + +if [ -d "$DISTRIB" ] ; then + rm -rf "$DISTRIB" +fi +mkdir $DISTRIB +mv /build/*.deb $DISTRIB/ +mv /build/$DISTRIB/*.deb /src