Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

Commit

Permalink
split beaker-review-checks into several jobs
Browse files Browse the repository at this point in the history
We are also now running it on our new Jenkins setup, which is using
configuration management, so we point at /etc/beaker/client-devel.conf
for the bkr config.
  • Loading branch information
danc86 committed Apr 4, 2016
1 parent 6a5547c commit c18be97
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 80 deletions.
20 changes: 20 additions & 0 deletions beaker-review-checks-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- job:
name: beaker-review-checks-docs
description: |
Builds Sphinx documentation for patches posted to Gerrit.
logrotate:
daysToKeep: 30
concurrent: true
scm: !include beaker-review-checks-scmconfig.yaml.inc
triggers: !include beaker-review-checks-triggerconfig.yaml.inc
builders:
- shell: |
make -C documentation html SPHINXOPTS="-W"
publishers:
- archive:
artifacts: documentation/_build/html/**
wrappers:
- publish-over-ssh-post-build:
site: "beaker-project.org jenkins-results"
source: "documentation/_build/html/**"
target: "$JOB_NAME/$BUILD_NUMBER"
Original file line number Diff line number Diff line change
@@ -1,76 +1,15 @@
- job:
name: beaker-review-checks
name: beaker-review-checks-dogfood-RedHatEnterpriseLinux6
description: |
Checks patches posted to Gerrit for review.
Patches are only checked after receiving a Ready-for-Checks+1 score
(granted automatically to Beaker core developers' patches).
Runs Beaker's test suite inside Beaker, for patches posted to Gerrit.
logrotate:
daysToKeep: 30
concurrent: true
scm:
- git:
browser: cgit
browser-url: https://git.beaker-project.org/cgit/beaker/
reference-repo: /var/lib/jenkins/jobs/beaker-rpms/workspace
url: ssh://[email protected]:29418/beaker
credentials-id: "fac135e6-5a13-4cd0-8dd5-737da825099b"
choosing-strategy: gerrit
name: gerrit
refspec: +refs/heads/*:refs/remotes/gerrit/* $GERRIT_REFSPEC
# 'branches' key is meaningless with Gerrit Trigger, but the
# default value '**' causes a NullPointerException:
# https://issues.jenkins-ci.org/browse/JENKINS-27559
branches:
- master
submodule:
recursive: true
merge:
remote: gerrit
branch: $GERRIT_BRANCH
changelog-against:
remote: gerrit
branch: $GERRIT_BRANCH
clean:
before: true
wipe-workspace: false
skip-tag: true
use-author: true
triggers:
- gerrit:
server-name: gerrit.beaker-project.org
projects:
- project-compare-type: PLAIN
project-pattern: beaker
branches:
- branch-compare-type: ANT
branch-pattern: "**"
trigger-on:
- comment-added-event:
approval-category: Ready-for-Checks
approval-value: 1
custom-url: "https://beaker-project.org/jenkins-results/${JOB_NAME}/${BUILD_NUMBER}/"
scm: !include beaker-review-checks-scmconfig.yaml.inc
triggers: !include beaker-review-checks-triggerconfig.yaml.inc
builders:
- shell: |
if [[ "$GIT_BRANCH" == "origin/develop" ]] ; then
Misc/rpmbuild.sh --next-major -bs
Misc/rpmbuild.sh --next-major -bb
else
Misc/rpmbuild.sh -bs
Misc/rpmbuild.sh -bb
fi
- shell: |
if [ -f Misc/rpmlint-config.py ] ; then # since Beaker 22
rpmlint -f Misc/rpmlint-config.py -o "NetworkEnabled False" rpmbuild-output/*.rpm rpmbuild-output/*/*.rpm
fi
- shell: |
make -C documentation html SPHINXOPTS="-W"
- shell: |
Misc/run-pylint.sh --report=no --disable=W bkr.server bkr.labcontroller bkr.client bkr.common
- shell: |
export BEAKER_CLIENT_CONF=/etc/beaker/client-devel.conf
job_submit_output=$(bkr job-submit - <<EOF
<job group="beakerdevs" retention_tag="scratch">
<whiteboard>
Expand Down Expand Up @@ -151,13 +90,13 @@
if [[ "$jobresult" != "Completed/Pass" ]] ; then
exit 1
fi
publishers:
- archive:
artifacts: beaker/**
- junit:
results: beaker/*/junit.xml

wrappers:
- publish-over-ssh-post-build:
site: "beaker-project.org jenkins-results"
source: "beaker/**"
target: "${JOB_NAME}/${BUILD_NUMBER}"
target: "$JOB_NAME/$BUILD_NUMBER"
22 changes: 22 additions & 0 deletions beaker-review-checks-pylint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- job:
name: beaker-review-checks-pylint
description: |
Runs pylint on patches posted to Gerrit.
logrotate:
daysToKeep: 30
concurrent: true
scm: !include beaker-review-checks-scmconfig.yaml.inc
triggers: !include beaker-review-checks-triggerconfig.yaml.inc
builders:
- shell: |
Misc/run-pylint.sh --report=no --disable=W \
bkr.server bkr.labcontroller bkr.client bkr.common \
| tee pylint.out
publishers:
- archive:
artifacts: pylint.out
wrappers:
- publish-over-ssh-post-build:
site: "beaker-project.org jenkins-results"
source: "pylint.out"
target: "$JOB_NAME/$BUILD_NUMBER"
38 changes: 38 additions & 0 deletions beaker-review-checks-rpms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
- job-template:
name: beaker-review-checks-rpms-{distro}
description: |
Builds RPMs for patches posted to Gerrit.
logrotate:
daysToKeep: 30
concurrent: true
scm: !include beaker-review-checks-scmconfig.yaml.inc
triggers: !include beaker-review-checks-triggerconfig.yaml.inc
builders:
- shell: |
Misc/rpmbuild.sh --next-major -bs
- critical-block-start
- shell: |
mkdir -p mock-result
/usr/bin/mock --resultdir=mock-result -r {mockconfig} --clean --rebuild rpmbuild-output/*.src.rpm
- critical-block-end
- shell: |
if [ -f Misc/rpmlint-config.py ] ; then # since Beaker 22
rpmlint -f Misc/rpmlint-config.py -o "NetworkEnabled False" mock-result/*.rpm
fi
publishers:
- archive:
artifacts: mock-result/**
wrappers:
- exclusion:
resources:
- mockroot{distro}
- publish-over-ssh-post-build:
site: "beaker-project.org jenkins-results"
source: "mock-result/**"
target: "$JOB_NAME/$BUILD_NUMBER"

- project:
name: beaker-review-checks-rpms
distro: !include beaker-rpms-distroconfig.yaml.inc
jobs:
- beaker-review-checks-rpms-{distro}
27 changes: 27 additions & 0 deletions beaker-review-checks-scmconfig.yaml.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- git:
browser: cgit
browser-url: https://git.beaker-project.org/cgit/beaker/
reference-repo: /var/lib/jenkins/jobs/beaker-rpms-RedHatEnterpriseLinux6/workspace
url: ssh://jenkins@gerrit.beaker-project.org:29418/beaker
credentials-id: "fac135e6-5a13-4cd0-8dd5-737da825099b"
choosing-strategy: gerrit
name: gerrit
refspec: +refs/heads/*:refs/remotes/gerrit/* $GERRIT_REFSPEC
# 'branches' key is meaningless with Gerrit Trigger, but the
# default value '**' causes a NullPointerException:
# https://issues.jenkins-ci.org/browse/JENKINS-27559
branches:
- master
submodule:
recursive: true
merge:
remote: gerrit
branch: $GERRIT_BRANCH
changelog-against:
remote: gerrit
branch: $GERRIT_BRANCH
clean:
before: true
wipe-workspace: false
skip-tag: true
use-author: true
13 changes: 13 additions & 0 deletions beaker-review-checks-triggerconfig.yaml.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- gerrit:
server-name: gerrit.beaker-project.org
projects:
- project-compare-type: PLAIN
project-pattern: beaker
branches:
- branch-compare-type: ANT
branch-pattern: "**"
trigger-on:
- comment-added-event:
approval-category: Ready-for-Checks
approval-value: 1
custom-url: "https://beaker-project.org/jenkins-results/$JOB_NAME/$BUILD_NUMBER/"
10 changes: 10 additions & 0 deletions beaker-rpms-distroconfig.yaml.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- Fedorarawhide:
mockconfig: fedora-rawhide-x86_64
- Fedora23:
mockconfig: fedora-23-x86_64
- Fedora22:
mockconfig: fedora-22-x86_64
- RedHatEnterpriseLinux7:
mockconfig: sed-rhel-7-x86_64
- RedHatEnterpriseLinux6:
mockconfig: eng-rhel-6-x86_64
18 changes: 7 additions & 11 deletions beaker-rpms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
recursive-submodules: true
triggers:
- pollscm: "H/5 * * * *"
wrappers:
- exclusion:
resources:
- mockroot{distro}
builders:
- critical-block-start
- shell: |
if [[ "$GIT_BRANCH" == "origin/develop" ]] ; then
Misc/rpmbuild.sh --next-major -bs
Expand All @@ -31,6 +36,7 @@
fi
mkdir -p mock-result
/usr/bin/mock --resultdir=mock-result -r {mockconfig} --clean --rebuild rpmbuild-output/*.src.rpm
- critical-block-end
- shell: |
# GIT_BRANCH is actually remote/branch, e.g. origin/develop
# so we export GIT_BRANCH_NAME as just the branch name, develop
Expand All @@ -51,16 +57,6 @@

- project:
name: beaker-rpms
distro:
- Fedorarawhide:
mockconfig: fedora-rawhide-x86_64
- Fedora23:
mockconfig: fedora-23-x86_64
- Fedora22:
mockconfig: fedora-22-x86_64
- RedHatEnterpriseLinux7:
mockconfig: sed-rhel-7-x86_64
- RedHatEnterpriseLinux6:
mockconfig: eng-rhel-6-x86_64
distro: !include beaker-rpms-distroconfig.yaml.inc
jobs:
- beaker-rpms-{distro}

0 comments on commit c18be97

Please sign in to comment.