mirror of
https://github.com/containers/conmon.git
synced 2026-02-05 06:46:42 +01:00
Initial PAPR CI check-in
Test conmon binary build on Fedora 28 in a container. Then make a SRPM from the current source tree and rpmbuild it. Finally, verify it installs cleanly and the packaging worked. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
27
.papr.yml
Normal file
27
.papr.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
branches:
|
||||
- master
|
||||
- auto
|
||||
- try
|
||||
|
||||
container:
|
||||
image: registry.fedoraproject.org/fedora:28
|
||||
|
||||
packages:
|
||||
- make
|
||||
- glib2-devel
|
||||
- git
|
||||
- gcc
|
||||
- rpm-build
|
||||
|
||||
tests:
|
||||
- make
|
||||
- make -f .rpmbuild/Makefile
|
||||
- rpmbuild --rebuild conmon-*.src.rpm
|
||||
- dnf -y install ~/rpmbuild/RPMS/x86_64/conmon*fc28.x86_64.rpm
|
||||
- ls -l /usr/libexec/crio/conmon
|
||||
|
||||
timeout: 20m
|
||||
|
||||
required: true
|
||||
|
||||
context: "Fedora build and package build/install"
|
||||
19
.rpmbuild/Makefile
Normal file
19
.rpmbuild/Makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/make -f
|
||||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
|
||||
outdir := $(CURDIR)
|
||||
topdir := $(CURDIR)/rpmbuild
|
||||
SHORT_COMMIT ?= $(shell git rev-parse --short=8 HEAD)
|
||||
|
||||
srpm:
|
||||
mkdir -p $(topdir)
|
||||
sh $(current_dir)/prepare.sh
|
||||
rpmbuild -bs -D "dist %{nil}" -D "_sourcedir build/" -D "_srcrpmdir $(outdir)" -D "_topdir $(topdir)" --nodeps contrib/spec/conmon.spec
|
||||
|
||||
build_binary:
|
||||
mkdir -p $(topdir)
|
||||
rpmbuild --rebuild -D "_rpmdir $(outdir)" -D "_topdir $(topdir)" $(outdir)/conmon-*.git$(SHORT_COMMIT).src.rpm
|
||||
|
||||
clean:
|
||||
rm -fr rpms
|
||||
rm -fr cri-o
|
||||
22
.rpmbuild/prepare.sh
Normal file
22
.rpmbuild/prepare.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh -euf
|
||||
set -x
|
||||
|
||||
if [ ! -e /usr/bin/git ]; then
|
||||
dnf -y install git-core
|
||||
fi
|
||||
|
||||
git fetch --unshallow || :
|
||||
|
||||
COMMIT=$(git rev-parse HEAD)
|
||||
COMMIT_SHORT=$(git rev-parse --short=8 HEAD)
|
||||
COMMIT_NUM=$(git rev-list HEAD --count)
|
||||
COMMIT_DATE=$(date +%s)
|
||||
|
||||
sed "s,#COMMIT#,${COMMIT},;
|
||||
s,#SHORTCOMMIT#,${COMMIT_SHORT},;
|
||||
s,#COMMITNUM#,${COMMIT_NUM},;
|
||||
s,#COMMITDATE#,${COMMIT_DATE}," \
|
||||
contrib/spec/conmon.spec.in > contrib/spec/conmon.spec
|
||||
|
||||
mkdir build/
|
||||
git archive --prefix "conmon-${COMMIT_SHORT}/" --format "tar.gz" HEAD -o "build/conmon-${COMMIT_SHORT}.tar.gz"
|
||||
@@ -8,12 +8,12 @@
|
||||
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
|
||||
%global import_path %{provider_prefix}
|
||||
%global git0 https://%{import_path}
|
||||
%global commit0 e7805e25a8d31c3202787d98a01071853ded8b87
|
||||
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
|
||||
%global commit0 #COMMIT#
|
||||
%global shortcommit0 %(c=%{commit0}; echo ${c:0:8})
|
||||
|
||||
Name: %{repo}
|
||||
Version: 0
|
||||
Release: 0.1.git%{shortcommit0}%{?dist}
|
||||
Release: #COMMITDATE#.git%{shortcommit0}%{?dist}
|
||||
Summary: OCI container runtime monitor
|
||||
License: ASL 2.0
|
||||
URL: %{git0}
|
||||
@@ -29,7 +29,7 @@ BuildRequires: pkgconfig
|
||||
%{summary}
|
||||
|
||||
%prep
|
||||
%autosetup -Sgit -n %{name}-%{commit0}
|
||||
%autosetup -Sgit -n %{name}-%{shortcommit0}
|
||||
|
||||
%build
|
||||
%{__make} all
|
||||
|
||||
Reference in New Issue
Block a user