From a811bf01374759b5350bfbfcb4cfaa110778ccdb Mon Sep 17 00:00:00 2001 From: Matt Jia Date: May 09 2017 03:08:49 +0000 Subject: [PATCH 1/2] fix the flake8 error in wsgi.py --- diff --git a/waiverdb/wsgi.py b/waiverdb/wsgi.py index 5038188..19e6300 100644 --- a/waiverdb/wsgi.py +++ b/waiverdb/wsgi.py @@ -13,4 +13,3 @@ from waiverdb.app import create_app, init_db app = create_app() init_db(app) - From 21b588e153d59aaa772e92a30160037731805d6f Mon Sep 17 00:00:00 2001 From: Matt Jia Date: May 10 2017 00:47:40 +0000 Subject: [PATCH 2/2] Jenkinsfile: send email notifications --- diff --git a/Jenkinsfile b/Jenkinsfile index 65fdfea..313cd36 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,48 +11,67 @@ */ node('rcm-tools-jslave-rhel-7') { - checkout scm - stage('Invoke Flake8') { - sh 'flake8' - } - stage('Build SRPM') { - sh './rpmbuild.sh -bs' - archiveArtifacts artifacts: 'rpmbuild-output/**' - } - /* We take a flock on the mock configs, to avoid multiple unrelated jobs on - * the same Jenkins slave trying to use the same mock root at the same - * time, which will error out. */ - stage('Build RPM') { - parallel ( - 'EPEL7': { - sh """ - mkdir -p mock-result/el7 - flock /etc/mock/epel-7-x86_64.cfg \ - /usr/bin/mock --resultdir=mock-result/el7 -r epel-7-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm - rpmlint -f rpmlint-config.py mock-result/el7/*.rpm - """ - archiveArtifacts artifacts: 'mock-result/el7/**' - }, - 'F25': { - sh """ - mkdir -p mock-result/f25 - flock /etc/mock/fedora-25-x86_64.cfg \ - /usr/bin/mock --resultdir=mock-result/f25 -r fedora-25-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm - rpmlint -f rpmlint-config.py mock-result/f25/*.rpm - """ - archiveArtifacts artifacts: 'mock-result/f25/**' - }, - ) + try { + checkout scm + stage('Invoke Flake8') { + sh 'flake8' + } + stage('Build SRPM') { + sh './rpmbuild.sh -bs' + archiveArtifacts artifacts: 'rpmbuild-output/**' + } + /* We take a flock on the mock configs, to avoid multiple unrelated jobs on + * the same Jenkins slave trying to use the same mock root at the same + * time, which will error out. */ + stage('Build RPM') { + parallel ( + 'EPEL7': { + sh """ + mkdir -p mock-result/el7 + flock /etc/mock/epel-7-x86_64.cfg \ + /usr/bin/mock --resultdir=mock-result/el7 -r epel-7-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm + rpmlint -f rpmlint-config.py mock-result/el7/*.rpm + """ + archiveArtifacts artifacts: 'mock-result/el7/**' + }, + 'F25': { + sh """ + mkdir -p mock-result/f25 + flock /etc/mock/fedora-25-x86_64.cfg \ + /usr/bin/mock --resultdir=mock-result/f25 -r fedora-25-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm + rpmlint -f rpmlint-config.py mock-result/f25/*.rpm + """ + archiveArtifacts artifacts: 'mock-result/f25/**' + }, + ) + } + } catch (e) { + currentBuild.result = "FAILED" + /* Can't use GIT_BRANCH because of this issue https://issues.jenkins-ci.org/browse/JENKINS-35230 */ + def git_branch = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim() + if (git_branch == 'master') { + step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'pnt-factory2-devel@redhat.com']) + } + throw e } } node('rcm-tools-jslave-rhel-7-docker') { - checkout scm - stage('Build Docker container') { - unarchive mapping: ['mock-result/el7/': '.'] - def el7_rpm = findFiles(glob: 'mock-result/el7/**/*.noarch.rpm')[0] - /* 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 'waiverdb', "--build-arg waiverdb_rpm=$el7_rpm ." + try { + checkout scm + stage('Build Docker container') { + unarchive mapping: ['mock-result/el7/': '.'] + def el7_rpm = findFiles(glob: 'mock-result/el7/**/*.noarch.rpm')[0] + /* 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 'waiverdb', "--build-arg waiverdb_rpm=$el7_rpm ." + } + } catch (e) { + currentBuild.result = "FAILED" + def git_branch = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim() + if (git_branch == 'master') { + step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'pnt-factory2-devel@redhat.com']) + } + throw e } }