Browse Source

CI: add centos8 build

doxygen_doc
Devan Carpenter 6 months ago
parent
commit
de131e2d18
6 changed files with 152 additions and 0 deletions
  1. +19
    -0
      .gitlab-ci.yml
  2. +29
    -0
      scripts/centos8/Makefile
  3. +25
    -0
      scripts/centos8/build_pEpEngine.sh
  4. +31
    -0
      scripts/centos8/build_pEpEngine_deps.sh
  5. +9
    -0
      scripts/centos8/install_pEpEngine_systemdb.sh
  6. +39
    -0
      scripts/centos8/pEpEngine.centos8.Dockerfile

+ 19
- 0
.gitlab-ci.yml View File

@ -25,3 +25,22 @@ debian10:tagged-build:
TAGGED_BUILD: "true"
rules:
- if: '$CI_COMMIT_TAG =~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/'
# CentOS
centos8:build:
extends: .make_in_docker
stage: build
variables:
CI_DISTRO_TARGET: "centos8"
rules:
- if: '$CI_COMMIT_TAG !~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/'
centos8:tagged-build:
extends: .make_in_docker
stage: build
variables:
CI_DISTRO_TARGET: "centos8"
TAGGED_BUILD: "true"
rules:
- if: '$CI_COMMIT_TAG =~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/'

+ 29
- 0
scripts/centos8/Makefile View File

@ -0,0 +1,29 @@
include ../../DEPENDENCIES
export
PEP_MACHINE_DIR= $(PKG_INSTALL_PATH)/share/pEp
YML2_VERSION=${yml2}
SEQUOIA_VERSION=$(shell echo ${sequoia} | sed 's/\//-/')
CURRENT_DISTRO=$(shell basename $(shell pwd))
IMAGE_NAME=${DOCKER_REGISTRY_HOST}/pep-$(CURRENT_DISTRO)-engine
DOCKERFILE=pEpEngine.$(CURRENT_DISTRO).Dockerfile
IS_TAGGED=${TAGGED_BUILD}
ifeq ($(IS_TAGGED), true)
# $CI_COMMIT_TAG is a predefined environment variable from Gitlab
PEPENGINE_VERSION=${CI_COMMIT_TAG}
else
PEPENGINE_VERSION=$(shell git rev-parse --short=8 HEAD)
endif
all:
-docker pull $(IMAGE_NAME):latest
cd ../../ && docker build --build-arg CURRENT_DISTRO=$(CURRENT_DISTRO) \
--build-arg DOCKER_REGISTRY_HOST=${DOCKER_REGISTRY_HOST} \
--build-arg PEPENGINE_VERSION=$(PEPENGINE_VERSION) \
--build-arg SEQUOIA_VERSION=$(SEQUOIA_VERSION) \
--build-arg YML2_VERSION=$(YML2_VERSION) \
--build-arg PEP_MACHINE_DIR=$(PEP_MACHINE_DIR) \
--cache-from $(IMAGE_NAME):latest \
--tag=$(IMAGE_NAME):$(PEPENGINE_VERSION) \
--tag=$(IMAGE_NAME):latest \
-f scripts/${CURRENT_DISTRO}/$(DOCKERFILE) .
docker push $(IMAGE_NAME):$(PEPENGINE_VERSION)
docker push $(IMAGE_NAME):latest

+ 25
- 0
scripts/centos8/build_pEpEngine.sh View File

@ -0,0 +1,25 @@
#!/usr/bin/env sh
set -exo
export LC_ALL=en_US.UTF-8
cat >local.conf <<__LOCAL__
PREFIX=${INSTPREFIX}
SQLITE3_FROM_OS=""
PER_MACHINE_DIRECTORY=${PEP_MACHINE_DIR}
YML2_PATH=${INSTPREFIX}/yml2
YML2_PROC=${INSTPREFIX}/yml2/yml2proc
ETPAN_LIB=-L${INSTPREFIX}/libetpan/lib
ETPAN_INC=-I${INSTPREFIX}/libetpan/include
ASN1C=${INSTPREFIX}/asn1c/bin/asn1c
ASN1C_INC=-I${INSTPREFIX}/asn1c/share/asn1c
OPENPGP=SEQUOIA
SEQUOIA_LIB=-L${INSTPREFIX}/lib
SEQUOIA_INC=-I${INSTPREFIX}/include
LDFLAGS += -L${INSTPREFIX}/lib -L${INSTPREFIX}/libetpan/lib -L${INSTPREFIX}/pep/lib -nostartfiles
__LOCAL__
cat local.conf
export PKG_CONFIG_PATH=$INSTPREFIX/share/pkgconfig/
make all && make db && make install

+ 31
- 0
scripts/centos8/build_pEpEngine_deps.sh View File

@ -0,0 +1,31 @@
#!/usr/bin/env sh
set -exo
### YML2
cd $INSTPREFIX
wget "https://gitea.pep.foundation/fdik/yml2/archive/${YML2_VERSION}.tar.gz"
tar -xf "${YML2_VERSION}.tar.gz"
rm -f ${YML2_VERSION}.tar*
### libetpan
git clone https://github.com/fdik/libetpan $BUILDROOT/libetpan
cd $BUILDROOT/libetpan
test -f configure || NOCONFIGURE=absolutely ./autogen.sh
./configure --prefix=${INSTPREFIX}/libetpan \
--without-openssl --without-gnutls --without-sasl \
--without-curl --without-expat --without-zlib \
--disable-dependency-tracking
make -j$(nproc)
make install
echo "${libetpan_ver}">${INSTPREFIX}/libetpan.ver
### ASN1c
git clone https://github.com/vlm/asn1c.git $BUILDROOT/asn1c
cd $BUILDROOT/asn1c
git checkout tags/v0.9.28 -b pep-engine
test -f configure || autoreconf -iv
./configure --prefix=${INSTPREFIX}/asn1c
make -j$(nproc) && make install
echo "${asn1c_ver}">${INSTPREFIX}/asn1c.ver

+ 9
- 0
scripts/centos8/install_pEpEngine_systemdb.sh View File

@ -0,0 +1,9 @@
#!/usr/bin/env sh
set -exo
# Install systemdb (need to be root depending on the path)
cd $BUILDROOT/pEpEngine
export LC_ALL=en_US.UTF-8
export PKG_CONFIG_PATH=$INSTPREFIX/share/pkgconfig/
echo "Setup DB"
make -C db install

+ 39
- 0
scripts/centos8/pEpEngine.centos8.Dockerfile View File

@ -0,0 +1,39 @@
ARG DOCKER_REGISTRY_HOST
ARG CURRENT_DISTRO
ARG PEPENGINE_VERSION
ARG SEQUOIA_VERSION
FROM ${DOCKER_REGISTRY_HOST}/pep-${CURRENT_DISTRO}-sequoia:${SEQUOIA_VERSION}
ENV BUILDROOT /build
ENV INSTPREFIX /install
ENV OUTDIR /out
ARG PEP_MACHINE_DIR
### Setup working directory
RUN mkdir ${BUILDROOT}/pEpEngine
COPY . ${BUILDROOT}/pEpEngine
USER root
RUN yum install -y python3 python3-lxml binutils && yum clean all
RUN chown -R pep-builder:pep-builder ${BUILDROOT}/pEpEngine
WORKDIR ${BUILDROOT}/pEpEngine
ARG YML2_VERSION
ARG ENGINE_VERSION
ARG CURRENT_DISTRO
### Build pEpEngine dependencies
USER pep-builder
RUN sh ./scripts/${CURRENT_DISTRO}/build_pEpEngine_deps.sh
### Build pEpEngine
RUN sh ./scripts/${CURRENT_DISTRO}/build_pEpEngine.sh
### Install Systemdb
USER root
RUN sh ./scripts/${CURRENT_DISTRO}/install_pEpEngine_systemdb.sh && \
rm -rf ${BUILDROOT}/*

Loading…
Cancel
Save