Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates
Browse files Browse the repository at this point in the history
Skip-PR-comments: true
Run-GHA: true

Required-githooks: true

Signed-off-by: Brian J. Murrell <brian.murrell@intel.com>
brianjmurrell committed Apr 16, 2024
1 parent e911dd8 commit 23edbe7
Showing 2 changed files with 62 additions and 3 deletions.
60 changes: 60 additions & 0 deletions ci/rpm/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

# Script for building RPMs in a chroot
# If the STAGE_NAME environment variable is present the script will
# attempt to parse it to determine what distribution to build for.
#
# For manual testing, you can set the environment variables CHROOT_NAME
# and TARGET can be set.
#
# Default is to build for CentOS 7.
# Fault injection will be enabled by default in CI unless a pragma has
# has disabled fault injection or this is a Release build
set -uex

id
if [ "$(id -u)" = "0" ]; then
echo "Should not be run as root"
exit 1
fi

mydir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
ci_envs="$mydir/../parse_ci_envs.sh"
if [ -e "${ci_envs}" ]; then
# shellcheck source=parse_ci_envs.sh
source "${ci_envs}"
fi

: "${SCONS_FAULTS_ARGS:=BUILD_TYPE=dev}"
SCONS_ARGS="${SCONS_FAULTS_ARGS}"

: "${CHROOT_NAME:='rocky+epel-8-x86_64'}"
: "${TARGET:='el8'}"
: "${REPO_SPEC:='el-8'}"

: "${COVFN_DISABLED:=true}"
: "${JOB_REPOS:=}"
EXTERNAL_COMPILER_OPT=""

if ! $COVFN_DISABLED && [[ $REPO_SPEC == el-* ]]; then
compiler_args="COMPILER=covc"
EXTERNAL_COMPILER_OPT=" --define \"compiler_args ${compiler_args}\""
fi

EXTERNAL_SCONS_OPT=" --define \"scons_args ${SCONS_ARGS}\""
EXTERNAL_RPM_BUILD_OPTIONS="${EXTERNAL_SCONS_OPT}${EXTERNAL_COMPILER_OPT}"

rm -rf "artifacts/${TARGET}/"
if ! mkdir -p "artifacts/${TARGET}/"; then
echo "Failed to create directory \"artifacts/${TARGET}/\""
ls -ld . || true
pwd || true
exit 1
fi

# shellcheck disable=SC2086
DEBEMAIL="$DAOS_EMAIL" DEBFULLNAME="$DAOS_FULLNAME" \
TOPDIR=$PWD make CHROOT_NAME="${CHROOT_NAME}" ${JOB_REPOS} \
EXTERNAL_RPM_BUILD_OPTIONS="${EXTERNAL_RPM_BUILD_OPTIONS}" \
SCONS_ARGS="${SCONS_ARGS}" DISTRO_VERSION="${DISTRO_VERSION}" \
-C utils/rpms chrootbuild
5 changes: 2 additions & 3 deletions ci/rpm/create_repo.sh
Original file line number Diff line number Diff line change
@@ -5,9 +5,8 @@ set -eux
# shellcheck disable=SC1091
. ci/gha_functions.sh

repo_path=$(repo_serial_increment)
repo_path=$(get_repo_path)
mkdir -p "$repo_path$TARGET"
cp -a "$BUILD_CHROOT"/result/*.rpm "$repo_path$TARGET"
mock -r rocky+epel-8-x86_64 --scrub=all --uniqueext "$RUN_ID"
cp -a mock_result/*.rpm "$repo_path$TARGET"
cd "$repo_path$TARGET"
createrepo .

0 comments on commit 23edbe7

Please sign in to comment.