From 3abbb08a459ccb4d7c7688f8e4252243ef08e0ba Mon Sep 17 00:00:00 2001 From: Matt Jia Date: Sep 29 2017 03:57:48 +0000 Subject: Jenkinsfile: cover f26 --- diff --git a/Dockerfile b/Dockerfile index b0516d7..8ad593b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,17 @@ -FROM centos:7 +FROM fedora:26 LABEL \ name="WaiverDB application" \ vendor="WaiverDB developers" \ license="GPLv2+" \ build-date="" -RUN yum -y install epel-release && yum -y clean all # The caller should build a waiverdb RPM package using ./rpmbuild.sh and then pass it in this arg. ARG waiverdb_rpm COPY $waiverdb_rpm /tmp -# XXX take out epel-testing eventually -RUN yum -y install --setopt=tsflags=nodocs --enablerepo=epel-testing \ +RUN dnf -y install \ python-gunicorn \ python-psycopg2 \ /tmp/$(basename $waiverdb_rpm) \ - && yum -y clean all + && dnf -y clean all USER 1001 EXPOSE 8080 ENTRYPOINT gunicorn --bind 0.0.0.0:8080 --access-logfile=- waiverdb.wsgi:app diff --git a/Jenkinsfile b/Jenkinsfile index 1969b1b..9ca2334 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -68,6 +68,14 @@ node('fedora') { """ archiveArtifacts artifacts: 'mock-result/f25/**' }, + 'F26': { + sh """ + mkdir -p mock-result/f26 + flock /etc/mock/fedora-26-x86_64.cfg \ + /usr/bin/mock --resultdir=mock-result/f26 -r fedora-26-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm + """ + archiveArtifacts artifacts: 'mock-result/f26/**' + }, ) } stage('Invoke Rpmlint') { @@ -78,16 +86,19 @@ node('fedora') { 'F25': { sh 'rpmlint -f rpmlint-config.py mock-result/f25/*.rpm' }, + 'F26': { + sh 'rpmlint -f rpmlint-config.py mock-result/f26/*.rpm' + }, ) } } node('docker') { checkout scm stage('Build Docker container') { - unarchive mapping: ['mock-result/el7/': '.'] - def el7_rpm = findFiles(glob: 'mock-result/el7/**/*.noarch.rpm')[0] + unarchive mapping: ['mock-result/f26/': '.'] + def f26_rpm = findFiles(glob: 'mock-result/f26/**/*.noarch.rpm')[0] def appversion = sh(returnStdout: true, script: """ - rpm2cpio ${el7_rpm} | \ + rpm2cpio ${f26_rpm} | \ cpio --quiet --extract --to-stdout ./usr/lib/python2.7/site-packages/waiverdb\\*.egg-info/PKG-INFO | \ awk '/^Version: / {print \$2}' """).trim() @@ -97,7 +108,7 @@ node('docker') { /* Note that the docker.build step has some magic to guess the * Dockerfile used, which will break if the build directory (here ".") * is not the final argument in the string. */ - def image = docker.build "factory2/waiverdb:${appversion}", "--build-arg waiverdb_rpm=$el7_rpm ." + def image = docker.build "factory2/waiverdb:${appversion}", "--build-arg waiverdb_rpm=$f26_rpm ." image.push() } /* Save container version for later steps (this is ugly but I can't find anything better...) */