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

Commit

Permalink
build Restraint RPMs in Brew instead of locally using mock
Browse files Browse the repository at this point in the history
Change-Id: If4871a92870accac764739ccbb05a1c455b25b58
  • Loading branch information
danc86 committed Aug 20, 2018
1 parent 1f88c87 commit 80e6a93
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 40 deletions.
20 changes: 20 additions & 0 deletions restraint-build-rpms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- builder:
name: restraint-build-rpms
builders:
- shell: |
rm -rf rpmbuild-output/ koji-result/
tito build --dist {dist} --test --srpm --output rpmbuild-output/
k5start -U -f $JENKINS_KEYTAB
# We will check exit status explicitly.
# We want to capture logs regardless whether the builds fails or not.
set +e
# Need to use python2 since Brew does not support gssapi auth yet
output=$(python2 /usr/bin/koji -p brew build --wait --scratch {kojitarget} rpmbuild-output/*.src.rpm)
rc=$?
taskid=$(grep -P -o '(?<=Created task: )\d+' <<<"$output")
mkdir -p koji-result
cd koji-result
python2 /usr/bin/koji -p brew download-logs --recurse --dir=. $taskid
python2 /usr/bin/koji -p brew download-task --noprogress $taskid
exit $rc
31 changes: 13 additions & 18 deletions restraint-review-checks-rpms.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- job-template:
name: restraint-review-checks-rpms-{distro}
description: |
Builds RPMs for {distro} in Beaker's Koji for patches posted to Gerrit.
Builds RPMs for {distro} for patches posted to Gerrit.
logrotate:
daysToKeep: 30
concurrent: true
Expand All @@ -12,28 +12,23 @@
ignorefail: "{ignorefail}"
builders:
- restraint-fetch-tarballs
- shell: |
rm -f *.src.rpm
tito build --dist {dist} --test --srpm --output .
output=$(koji -p beakerkoji build --nowait --scratch --arch-override=x86_64 {kojitag} *.src.rpm)
if [[ $? -ne 0 ]] ; then
echo "$output" >&2
exit 1
fi
taskid=$(grep -P -o '(?<=Created task: )\d+' <<<"$output")
set +e
koji -p beakerkoji watch-task $taskid
rc=$?
mkdir -p koji-logs
koji -p beakerkoji download-logs -r -d koji-logs $taskid
exit $rc
- restraint-build-rpms:
dist: "{dist}"
kojitarget: "{kojitarget}"
publishers:
- archive:
artifacts: koji-logs/**
artifacts: koji-result/**
wrappers:
- credentials-binding:
- file:
credential-id: "1fc5282d-0e61-4736-ace4-9ff23b065636"
variable: JENKINS_KEYTAB
- publish-over-ssh-post-build:
site: "beaker-project.org jenkins-results"
source: "koji-logs/**"
# Not saving the RPMs because they are too big.
# After https://bugzilla.redhat.com/show_bug.cgi?id=1559638 is done they should be smaller,
# consider adding them then.
source: "koji-result/**/*.log"
target: "$JOB_NAME/$BUILD_NUMBER"

- project:
Expand Down
23 changes: 12 additions & 11 deletions restraint-rpms-distroconfig.yaml.inc
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
- Fedorarawhide:
dist: .fc29
kojitag: beaker-harness-fedora-rawhide
ignorefail: "1"
# RCM has not created this yet: https://projects.engineering.redhat.com/browse/RCM-38028
#- Fedorarawhide:
# dist: .fc30
# kojitarget: beaker-harness-fedora-rawhide
# ignorefail: "1"
- Fedora28:
dist: .fc28
kojitag: beaker-harness-fedora-28
kojitarget: eng-fedora-28-candidate
ignorefail: ""
- Fedora27:
dist: .fc27
kojitag: beaker-harness-fedora-27
kojitarget: eng-fedora-27-candidate
ignorefail: ""
- RedHatEnterpriseLinux7:
dist: .el7bkr
kojitag: beaker-harness-rhel-7
kojitarget: beaker-harness-rhel-7-candidate
ignorefail: ""
- RedHatEnterpriseLinux6:
dist: .el6bkr
kojitag: beaker-harness-rhel-6
kojitarget: beaker-harness-rhel-6-candidate
ignorefail: ""
- RedHatEnterpriseLinux5:
dist: .el5bkr
kojitag: beaker-harness-rhel-5
kojitarget: beaker-harness-rhel-5-candidate
ignorefail: ""
- RedHatEnterpriseLinux4:
dist: .el4_8
kojitag: beaker-harness-rhel-4
dist: .el4bkr
kojitarget: beaker-harness-rhel-4-candidate
ignorefail: ""
29 changes: 18 additions & 11 deletions restraint-rpms.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- job-template:
name: restraint-rpms-{distro}
description: |
Builds RPMs for {distro} in Beaker's Koji based on every restraint commit.
Builds RPMs for {distro} in Brew based on every restraint commit.
properties:
- priority-sorter:
priority: 120
Expand All @@ -19,18 +19,25 @@
triggers:
- pollscm:
cron: "H/5 * * * *"
wrappers:
- credentials-binding:
- file:
credential-id: "1fc5282d-0e61-4736-ace4-9ff23b065636"
variable: JENKINS_KEYTAB
builders:
- restraint-fetch-tarballs
- shell: |
rm -f *.src.rpm
commits_since_tag=$(git rev-list $(git describe --abbrev=0).. | wc -l)
if [ "$commits_since_tag" -eq 0 ] ; then
tito build --dist {dist} --srpm --output .
koji -p beakerkoji build --wait {kojitag} ./restraint*{dist}.src.rpm
else
tito build --dist {dist} --srpm --output . --test
koji -p beakerkoji build --wait {kojitag}-testing ./restraint*{dist}.src.rpm
fi
- restraint-build-rpms:
dist: "{dist}"
kojitarget: "{kojitarget}"
publishers:
- archive:
artifacts: koji-result/**
- ssh:
site: "beaker-project.org nightlies"
source: koji-result/*.rpm
remove-prefix: koji-result/
target: "harness/{distro}/"
command: "createrepo_c --update --no-database /srv/www/nightlies/harness/{distro}/"
notifications:
- notify-matrix-bot

Expand Down

0 comments on commit 80e6a93

Please sign in to comment.