-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create method to build stand-alone pbench server
We modify the Pbench-in-a-Can build process to first create a stand-alone Pbench Server container image, and then build an image based on that image which is used for the CI environment.
- Loading branch information
Showing
5 changed files
with
72 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This script builds a stand-alone Pbench Server container with just the base | ||
# software installed. | ||
# | ||
|
||
set -o errexit | ||
|
||
#+ | ||
# Configuration definition section. | ||
#- | ||
|
||
BASE_IMAGE=${BASE_IMAGE:-registry.access.redhat.com/ubi9:latest} | ||
RPM_PATH=${RPM_PATH:-/root/sandbox/rpmbuild/RPMS/noarch/pbench-server-*.rpm} | ||
|
||
HOSTNAME_F=pbench-server | ||
|
||
# Locations on the host | ||
GITTOP=${GITTOP:-$(git rev-parse --show-toplevel)} | ||
|
||
PBINC_SERVER=${GITTOP}/server | ||
# Image tag determined from jenkins/branch.name | ||
PB_SERVER_IMAGE_TAG=${PB_SERVER_IMAGE_TAG:-$(< ${GITTOP}/jenkins/branch.name)} | ||
|
||
#+ | ||
# Configuration verification section. | ||
#- | ||
|
||
if (( $(ls ${RPM_PATH} 2>/dev/null | wc -l) != 1 )) | ||
then | ||
echo "RPM_PATH (${RPM_PATH}) does not uniquely identify the RPM file" >&2 | ||
exit 2 | ||
fi | ||
|
||
#+ | ||
# Container build section. | ||
#- | ||
|
||
# Open a copy of the base container. Docker format is required in order to set | ||
# the hostname. | ||
container=$(buildah from --format=docker ${BASE_IMAGE}) | ||
|
||
# Provide a few useful defaults for labels and the host name to use, and expose | ||
# port 80 for the Apache2 httpd process acting as a proxy. | ||
buildah config \ | ||
--label maintainer="Pbench Maintainers <[email protected]>" \ | ||
--hostname $HOSTNAME_F \ | ||
--port 80 `# pbench-server` \ | ||
$container | ||
|
||
buildah copy $container ${RPM_PATH} /tmp/pbench-server.rpm | ||
buildah run $container dnf update -y | ||
buildah run $container dnf install -y --setopt=tsflags=nodocs \ | ||
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm | ||
buildah run $container dnf install -y /tmp/pbench-server.rpm httpd | ||
buildah run $container dnf clean all | ||
buildah run $container rm -f /tmp/pbench-server.rpm | ||
|
||
# Create the container image | ||
buildah commit $container localhost/pbench-server:${PB_SERVER_IMAGE_TAG} |
This file was deleted.
Oops, something went wrong.