infra: Create 3rd party CI job to verify bifrost patches in OPNFV 61/20761/8
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Fri, 9 Sep 2016 11:18:11 +0000 (13:18 +0200)
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>
Fri, 9 Sep 2016 12:19:13 +0000 (14:19 +0200)
This change creates job to run patchset verification for openstack/bifrost.
The verification is done by checking out the patch from upstream bifrost
repo and combining opnfv bifrost stuff with it to see if any change that
is proposed upstream breaks opnfv bifrost.

The verification is done only for trusty and this can be expanded to support
centos7 and suse as well.

Due to change in slave label, impacted files are also updated.

Change-Id: Id34b7ddcf5e3f424a5999aa1a9fa69ff53d95fc4
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
jjb/infra/infra-daily-jobs.yml
jjb/infra/openstack-bifrost-verify-jobs.yml [new file with mode: 0644]
jjb/infra/openstack-bifrost-verify.sh [new file with mode: 0755]
jjb/opnfv/slave-params.yml

index a066e7d..df90c6d 100644 (file)
@@ -16,7 +16,7 @@
 #--------------------------------
     pod:
         - virtual:
-            slave-label: infra-virtual
+            slave-label: infra-virtual-trusty
             <<: *master
 #--------------------------------
 #       phases
diff --git a/jjb/infra/openstack-bifrost-verify-jobs.yml b/jjb/infra/openstack-bifrost-verify-jobs.yml
new file mode 100644 (file)
index 0000000..9ae969e
--- /dev/null
@@ -0,0 +1,111 @@
+- project:
+    name: 'openstack-bifrost-verify'
+
+    project: 'releng'
+#--------------------------------
+# branches
+#--------------------------------
+    stream:
+        - master:
+            branch: '{stream}'
+#--------------------------------
+# distros
+# jobs for centos7 and suse can be enabled once the support is there
+#--------------------------------
+    distro:
+        - 'trusty':
+            slave-label: infra-virtual-trusty
+            disabled: false
+        - 'centos7':
+            slave-label: infra-virtual-trusty
+            disabled: true
+        - 'suse':
+            slave-label: infra-virtual-trusty
+            disabled: true
+#--------------------------------
+# jobs
+#--------------------------------
+    jobs:
+        - 'openstack-bifrost-verify-{distro}-{stream}'
+#--------------------------------
+# job templates
+#--------------------------------
+- job-template:
+    name: 'openstack-bifrost-verify-{distro}-{stream}'
+
+    concurrent: false
+
+    disabled: '{obj:disabled}'
+
+    properties:
+        - build-blocker:
+            use-build-blocker: true
+            blocking-jobs:
+                - 'infra-os-.*?-daily-.*'
+            block-level: 'NODE'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - string:
+            name: DISTRO
+            default: '{distro}'
+        - string:
+            name: CLEAN_DIB_IMAGES
+            default: 'true'
+        - '{slave-label}-defaults'
+
+    scm:
+        - git-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            branch: '{branch}'
+
+    triggers:
+        - gerrit:
+            server-name: 'review.openstack.org'
+            silent-start: true
+            skip-vote:
+                successful: true
+                failed: true
+                unstable: true
+                notbuilt: true
+            escape-quotes: true
+            trigger-on:
+                - patchset-created-event:
+                    exclude-drafts: 'false'
+                    exclude-trivial-rebase: 'false'
+                    exclude-no-code-change: 'false'
+                - comment-added-contains-event:
+                    comment-contains-value: 'recheck'
+            projects:
+              - project-compare-type: 'PLAIN'
+                project-pattern: '{project}'
+                branches:
+                  - branch-compare-type: 'ANT'
+                    branch-pattern: '**/master'
+                forbidden-file-paths:
+                  - compare-type: ANT
+                    pattern: 'doc/**'
+                  - compare-type: ANT
+                    pattern: 'releasenotes/**'
+            readable-message: true
+
+    builders:
+        - description-setter:
+            description: "Built on $NODE_NAME"
+        - 'openstack-bifrost-verify-builder'
+
+    publishers:
+        - email:
+            recipients: fatih.degirmenci@ericsson.com yroblamo@redhat.com mchandras@suse.de jack.morgan@intel.com zhang.jun3g@zte.com.cn
+#####################################
+# builder macros
+#####################################
+- builder:
+    name: 'openstack-bifrost-verify-builder'
+    builders:
+        - shell: |
+            #!/bin/bash
+
+            sudo $WORKSPACE/jjb/infra/openstack-bifrost-verify.sh
diff --git a/jjb/infra/openstack-bifrost-verify.sh b/jjb/infra/openstack-bifrost-verify.sh
new file mode 100755 (executable)
index 0000000..a4653f9
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2016 Ericsson AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# check distro to see if we support it
+# we will have centos and suse supported in future
+case "$DISTRO" in
+    trusty)
+        #start the test
+        echo "Starting provisioning of 3 VMs"
+        ;;
+    *)
+        echo "Distro $DISTRO is not supported!"
+        exit 1
+esac
+
+# remove previously cloned repos
+/bin/rm -rf /opt/bifrost /opt/puppet-infracloud /opt/releng
+
+# clone upstream bifrost repo and checkout the patch to verify
+git clone https://git.openstack.org/openstack/bifrost /opt/bifrost
+cd /opt/bifrost
+git fetch https://git.openstack.org/openstack/bifrost $GERRIT_REFSPEC && git checkout FETCH_HEAD
+
+# clone puppet-infracloud
+git clone https://git.openstack.org/openstack-infra/puppet-infracloud /opt/puppet-infracloud
+
+# combine opnfv and upstream scripts/playbooks
+cp -R $WORKSPACE/prototypes/bifrost/* /opt/bifrost/
+
+# cleanup remnants of previous deployment
+cd /opt/bifrost
+./scripts/destroy-env.sh
+
+# provision 3 VMs; jumphost, controller, and compute
+cd /opt/bifrost
+./scripts/test-bifrost-deployment.sh
+
+# list the provisioned VMs
+cd /opt/bifrost
+source env-vars
+ironic node-list
+virsh list
index 442c4f7..b2f17c1 100644 (file)
             default: https://gerrit.opnfv.org/gerrit/$PROJECT
             description: 'Git URL to use on this Jenkins Slave'
 - parameter:
-    name: 'infra-virtual-defaults'
+    name: 'infra-virtual-trusty-defaults'
     parameters:
         - label:
             name: SLAVE_LABEL
-            default: 'infra-virtual'
+            default: 'infra-virtual-trusty'
         - string:
             name: GIT_BASE
             default: https://gerrit.opnfv.org/gerrit/$PROJECT