[jenkins-ci PATCH v2 1/4] jobs: Make Python version configurable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some projects, namely libvirt-python, support Python 2 and Python 3,
so we'd like to have CI coverage of both; other projects, namely
virt-manager, no longer support Python 2 so we need to start building
them using Python 3 instead.

After this change, the names of jobs as well as workspaces include
the Python version so that they can happily live side by side.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 jobs/python-distutils.yaml   | 22 +++++++++++-----------
 projects/libvirt-python.yaml |  7 +++++--
 projects/virt-manager.yaml   | 11 +++++++----
 3 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/jobs/python-distutils.yaml b/jobs/python-distutils.yaml
index 47b25f1..122c759 100644
--- a/jobs/python-distutils.yaml
+++ b/jobs/python-distutils.yaml
@@ -1,11 +1,11 @@
 
 - job-template:
     id: python-distutils-build-job
-    name: '{name}-{branch}-build'
+    name: '{name}-{branch}-{python}-build'
     project-type: matrix
-    description: '{title} Build'
+    description: '{title} Build ({python})'
     command_pre_build: ''
-    workspace: '{name}-{branch}'
+    workspace: '{name}-{branch}-{python}'
     child-workspace: '.'
     block-downstream: true
     block-upstream: true
@@ -43,8 +43,8 @@
           {global_env}
           {local_env}
           {command_pre_build}
-          python2 setup.py build
-          python2 setup.py install --prefix=$VIRT_PREFIX
+          {python} ./setup.py build
+          {python} ./setup.py install --prefix=$VIRT_PREFIX
     publishers:
       - email:
           recipients: '{obj:spam}'
@@ -54,9 +54,9 @@
 
 - job-template:
     id: python-distutils-check-job
-    name: '{name}-{branch}-check'
+    name: '{name}-{branch}-{python}-check'
     project-type: matrix
-    description: '{title} Check'
+    description: '{title} Check ({python})'
     workspace: '{name}-{branch}'
     child-workspace: '.'
     block-downstream: true
@@ -83,7 +83,7 @@
       - shell: |
           {global_env}
           {local_env}
-          python2 setup.py test
+          {python} ./setup.py test
     publishers:
       - email:
           recipients: '{obj:spam}'
@@ -92,9 +92,9 @@
 
 - job-template:
     id: python-distutils-rpm-job
-    name: '{name}-{branch}-rpm'
+    name: '{name}-{branch}-{python}-rpm'
     project-type: matrix
-    description: '{title} RPM'
+    description: '{title} RPM ({python})'
     workspace: '{name}-{branch}'
     child-workspace: '.'
     block-downstream: true
@@ -122,7 +122,7 @@
           {global_env}
           {local_env}
           sed -i -e 's/BuildRequires: libvirt.*devel.*//' *.spec.in
-          python2 setup.py rpm
+          {python} ./setup.py rpm
     publishers:
       - email:
           recipients: '{obj:spam}'
diff --git a/projects/libvirt-python.yaml b/projects/libvirt-python.yaml
index dd8ac13..540238d 100644
--- a/projects/libvirt-python.yaml
+++ b/projects/libvirt-python.yaml
@@ -14,11 +14,14 @@
     title: Libvirt Python
     jobs:
       - python-distutils-build-job:
+          python: python2
           parent_jobs: 'libvirt-master-build'
       - python-distutils-check-job:
-          parent_jobs: 'libvirt-python-master-build'
+          python: python2
+          parent_jobs: 'libvirt-python-master-{python}-build'
       - python-distutils-rpm-job:
-          parent_jobs: 'libvirt-python-master-check'
+          python: python2
+          parent_jobs: 'libvirt-python-master-{python}-check'
           machines:
             - libvirt-centos-6
             - libvirt-centos-7
diff --git a/projects/virt-manager.yaml b/projects/virt-manager.yaml
index c1d198b..2d13c15 100644
--- a/projects/virt-manager.yaml
+++ b/projects/virt-manager.yaml
@@ -13,15 +13,18 @@
     title: Virtual Machine Manager
     jobs:
       - python-distutils-build-job:
+          python: python2
           parent_jobs:
-            - 'libvirt-python-master-build'
+            - 'libvirt-python-master-{python}-build'
             - 'libosinfo-master-build'
           command_pre_build: |
-            python2 setup.py configure --prefix=$VIRT_PREFIX
+            {python} ./setup.py configure --prefix=$VIRT_PREFIX
       - python-distutils-check-job:
-          parent_jobs: 'virt-manager-master-build'
+          python: python2
+          parent_jobs: 'virt-manager-master-{python}-build'
       - python-distutils-rpm-job:
-          parent_jobs: 'virt-manager-master-check'
+          python: python2
+          parent_jobs: 'virt-manager-master-{python}-check'
           machines:
             - libvirt-centos-7
             - libvirt-fedora-26
-- 
2.14.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux