From d6eaa493bd68b51d44856f7cb8840fe5661a88ae Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 3 Aug 2012 09:31:12 -0700 Subject: [PATCH] Add periodic bitrot check jobs. Add jobs that run daily to make sure stable branches still pass tests. Added as a template that can be added to any project and any branch. Change-Id: I90c2bab2afd8e1ad7077f3473504069b0dad9876 --- modules/jenkins_jobs/files/modules/scm.py | 8 +- .../files/projects/openstack/nova.yml | 26 +++++ .../files/templates/python_bitrot_jobs.yml | 102 ++++++++++++++++++ 3 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 modules/jenkins_jobs/files/templates/python_bitrot_jobs.yml diff --git a/modules/jenkins_jobs/files/modules/scm.py b/modules/jenkins_jobs/files/modules/scm.py index 1a4e039c92..1b8ffbabc3 100644 --- a/modules/jenkins_jobs/files/modules/scm.py +++ b/modules/jenkins_jobs/files/modules/scm.py @@ -45,9 +45,11 @@ class SCM(object): XML.SubElement(huser, 'name').text = 'origin' XML.SubElement(huser, 'refspec').text = '+refs/heads/*:refs/remotes/origin/*' XML.SubElement(huser, 'url').text = 'git://github.com/{org}/{project}.git'.format(org=main['github_org'], project=main['project']) - branches = XML.SubElement(scm, 'branches') - bspec = XML.SubElement(branches, 'hudson.plugins.git.BranchSpec') - XML.SubElement(bspec, 'name').text = '**' + xml_branches = XML.SubElement(scm, 'branches') + branches = self.data['scm'].get('branches', ['**']) + for branch in branches: + bspec = XML.SubElement(xml_branches, 'hudson.plugins.git.BranchSpec') + XML.SubElement(bspec, 'name').text = branch XML.SubElement(scm, 'disableSubmodules').text = 'false' XML.SubElement(scm, 'recursiveSubmodules').text = 'false' XML.SubElement(scm, 'doGenerateSubmoduleConfigurations').text = 'false' diff --git a/modules/jenkins_jobs/files/projects/openstack/nova.yml b/modules/jenkins_jobs/files/projects/openstack/nova.yml index 099b51a233..69f46c5aa2 100644 --- a/modules/jenkins_jobs/files/projects/openstack/nova.yml +++ b/modules/jenkins_jobs/files/projects/openstack/nova.yml @@ -8,6 +8,32 @@ values: review_site: 'review.openstack.org' node: 'precise' +--- +project: + template: 'python_bitrot_jobs' + +values: + name: 'nova' + disabled: 'false' + github_org: 'openstack' + review_site: 'review.openstack.org' + node: 'oneiric' + branch_name: 'stable-diablo' + branch_spec: 'stable/diablo' + +--- +project: + template: 'python_bitrot_jobs' + +values: + name: 'nova' + disabled: 'false' + github_org: 'openstack' + review_site: 'review.openstack.org' + node: 'precise' + branch_name: 'stable-essex' + branch_spec: 'stable/essex' + --- project: template: 'openstack_publish_jobs' diff --git a/modules/jenkins_jobs/files/templates/python_bitrot_jobs.yml b/modules/jenkins_jobs/files/templates/python_bitrot_jobs.yml new file mode 100644 index 0000000000..c75c30f394 --- /dev/null +++ b/modules/jenkins_jobs/files/templates/python_bitrot_jobs.yml @@ -0,0 +1,102 @@ +--- +# python26-gate +main: + name: 'periodic-@NAME@-python26-@BRANCH_NAME@' + review_site: '@REVIEW_SITE@' + github_org: '@GITHUB_ORG@' + project: '@NAME@' + authenticatedBuild: 'false' + disabled: @DISABLED@ + concurrent: 'true' + +logrotate: + daysToKeep: 28 + numToKeep: -1 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + +triggers: + - timed: '@daily' + +builders: + - python26 + +post_build_actions: + - junit: + results: '**/nosetests.xml' + +scm: + scm: 'true' + branches: + - '@BRANCH_SPEC@' + +# >= precise does not have python2.6 +assignednode: + node: 'oneiric' + +--- +# python27-gate +main: + name: 'periodic-@NAME@-python27-@BRANCH_NAME@' + review_site: '@REVIEW_SITE@' + github_org: '@GITHUB_ORG@' + project: '@NAME@' + authenticatedBuild: 'false' + disabled: @DISABLED@ + concurrent: 'true' + +logrotate: + daysToKeep: 28 + numToKeep: -1 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + +triggers: + - timed: '@daily' + +builders: + - python27 + +post_build_actions: + - junit: + results: '**/nosetests.xml' + +scm: + scm: 'true' + branches: + - '@BRANCH_SPEC@' + +assignednode: + node: '@NODE@' + +--- +# docs-gate +main: + name: 'periodic-@NAME@-docs-@BRANCH_NAME@' + review_site: '@REVIEW_SITE@' + github_org: '@GITHUB_ORG@' + project: '@NAME@' + authenticatedBuild: 'false' + disabled: @DISABLED@ + concurrent: 'true' + +logrotate: + daysToKeep: 28 + numToKeep: -1 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + +triggers: + - timed: '@daily' + +builders: + - docs + +scm: + scm: 'true' + branches: + - '@BRANCH_SPEC@' + +assignednode: + node: '@NODE@' +