Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
webbnh committed Jul 29, 2022
1 parent 2c49e29 commit ae7668c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
30 changes: 30 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
# various artifacts for the Pbench product. It is intended to be run from the
# root directory of a Git branch checkout.

# The following variables will normally be defined as credentials in the Jenkins
# environment. For developer use of this script, they should be defined in the
# shell environment; otherwise, they will be given default values, here.
#
# PODMAN_USR - the username for the container registry account
# PODMAN_PSW - the password for the container registry account
#
PODMAN_USR=${PODMAN_USR-"pbench+mr_jenkins"}
PODMAN_PSW=${PODMAN_PSW-${DEFAULT_PODMAN_PASSWORD}}
CONTAINER_REGISTRY=${CONTAINER_REGISTRY-images.paas.redhat.com}

# Install the linter requirements and add them to the PATH.
export PATH=${HOME}/.local/bin:${PATH}
Expand Down Expand Up @@ -32,4 +42,24 @@ flake8 .
tox # Agent and Server unit tests and legacy tests
( cd dashboard && CI=true npm test ) # Dashboard unit tests

# The following steps don't work inside the CI container, yet.
exit 0

################################################################################
# Future extensions
################################################################################

# Build Agent and Server RPMs
( cd agent/rpm && make ci-build )
( cd server/rpm && make ci-build )

# Need to log into the registry to access the Server base image, etc.
podman login -u="${PODMAN_USR}" -p="${PODMAN_PSW}" quay.io

# Build the Agent container images and the Pbench-in-a-Can Server image
( cd agent/containers/images && make TEST=ci )
server/pbenchinacan/container-build.sh

# Push the Agent and Server container images to the container registry.
( cd agent/containers/images && make TEST=ci tag-ci push-ci )
podman push podman pull ${CONTAINER_REGISTRY}/pbench/pbenchinacan-pbenchserver
10 changes: 8 additions & 2 deletions jenkins/Pipeline.gy
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
pipeline {
agent { label 'pbench' }
environment {
IMAGE_ROLE="ci"
EXTRA_PODMAN_SWITCHES="--pull=always -e=COV_REPORT_XML=yes -e=PODMAN*"
IMAGE_KIND="fedora"
IMAGE_REPO="quay.io/pbench"
EXTRA_PODMAN_SWITCHES="--pull=always -e COV_REPORT_XML=yes"
IMAGE_ROLE="ci"
NO_COLORS=0
PODMAN=credentials('87ad2797-02eb-464f-989f-8ab78d63cdf3')
PY_COLORS=0
TERM='dumb'
}
stages {
stage('Linting & Unit Tests') {
steps {
// If we don't have a sequence number file left over from a
// previous run, then create one.
sh 'if [[ ! -e agent/rpm/seqno ]] ; then echo "1" > agent/rpm/seqno ; fi'
sh 'if [[ ! -e server/rpm/seqno ]] ; then echo "1" > server/rpm/seqno ; fi'

// If there is somehow a symlink left over from a previous run's
// Cobertura processing, remove it, because it seems to confuse
// the coverage data collection.
Expand Down
10 changes: 10 additions & 0 deletions jenkins/ci.fedora.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ RUN \
`#` \
npm \
tox \
`#` \
`# Required for building RPMs` \
`#` \
python3-jinja2-cli \
rpmlint \
`#` \
`# Required for building containers` \
`#` \
buildah \
podman \
&& \
`#` \
`# Save space in the container image.` \
Expand Down

0 comments on commit ae7668c

Please sign in to comment.