Enable ovn4nfv-k8s-plugins project jobs 73/64973/6
authorVictor Morales <victor.morales@intel.com>
Sat, 10 Nov 2018 01:19:53 +0000 (17:19 -0800)
committerVictor Morales <victor.morales@intel.com>
Wed, 14 Nov 2018 00:32:27 +0000 (16:32 -0800)
Change-Id: Ib61a1be6746fc67eddc0766e87837ff5d34cfe34
Signed-off-by: Victor Morales <victor.morales@intel.com>
jjb/ovn4nfv/golang-make-test.sh [new file with mode: 0644]
jjb/ovn4nfv/ovn4nfv-k8s-plugins-project-jobs.yaml [new file with mode: 0644]

diff --git a/jjb/ovn4nfv/golang-make-test.sh b/jjb/ovn4nfv/golang-make-test.sh
new file mode 100644 (file)
index 0000000..7ed4632
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 Intel Corporation.
+# 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 pipefail
+
+source /etc/os-release || source /usr/lib/os-release
+case ${ID,,} in
+    ubuntu|debian)
+    sudo add-apt-repository -y ppa:longsleep/golang-backports
+    sudo apt-get update
+    sudo apt-get install -y build-essential golang-go
+    sudo apt-get -y clean && sudo apt-get -y autoremove
+    ;;
+esac
+
+echo "Running unit tests in Go ${golang_version} ..."
+cd $WORKSPACE
+make test
diff --git a/jjb/ovn4nfv/ovn4nfv-k8s-plugins-project-jobs.yaml b/jjb/ovn4nfv/ovn4nfv-k8s-plugins-project-jobs.yaml
new file mode 100644 (file)
index 0000000..dfc3d93
--- /dev/null
@@ -0,0 +1,109 @@
+---
+- project:
+    name: ovn4nfv-k8s-plugins-project-jobs
+
+    project: 'ovn4nfv-k8s-plugins'
+
+    jobs:
+      - 'ovn4nfv-k8s-plugins-verify-{stream}'
+      - 'ovn4nfv-k8s-plugins-merge-{stream}'
+
+    stream:
+      - master:
+          branch: '{stream}'
+          gs-pathname: ''
+          disabled: false
+
+################################
+# job templates
+################################
+
+- job-template:
+    name: 'ovn4nfv-k8s-plugins-verify-{stream}'
+
+    disabled: '{obj:disabled}'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+          branch: '{branch}'
+      - opnfv-build-defaults
+
+    scm:
+      - git-scm-gerrit
+
+    triggers:
+      - gerrit:
+          server-name: 'gerrit.opnfv.org'
+          trigger-on:
+            - patchset-created-event:
+                exclude-drafts: 'false'
+                exclude-trivial-rebase: 'false'
+                exclude-no-code-change: 'false'
+            - draft-published-event
+            - comment-added-contains-event:
+                comment-contains-value: 'recheck'
+            - comment-added-contains-event:
+                comment-contains-value: 'reverify'
+          projects:
+            - project-compare-type: 'ANT'
+              project-pattern: '{project}'
+              branches:
+                - branch-compare-type: 'ANT'
+                  branch-pattern: '**/{branch}'
+
+    wrappers:
+      - ssh-agent-wrapper
+      - timeout:
+          timeout: 30
+          fail: true
+
+    builders:
+      - ovn4nfv-k8s-plugins-unit-tests-golang
+
+- job-template:
+    name: 'ovn4nfv-k8s-plugins-merge-{stream}'
+
+    disabled: '{obj:disabled}'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+          branch: '{branch}'
+      - opnfv-build-defaults
+
+    scm:
+      - git-scm
+
+    triggers:
+      - gerrit:
+          server-name: 'gerrit.opnfv.org'
+          trigger-on:
+            - change-merged-event
+            - comment-added-contains-event:
+                comment-contains-value: 'remerge'
+          projects:
+            - project-compare-type: 'ANT'
+              project-pattern: '{project}'
+              branches:
+                - branch-compare-type: 'ANT'
+                  branch-pattern: '**/{branch}'
+
+    wrappers:
+      - ssh-agent-wrapper
+      - timeout:
+          timeout: 30
+          fail: true
+
+    builders:
+      - ovn4nfv-k8s-plugins-unit-tests-golang
+
+################################
+# job builders
+################################
+
+- builder:
+    name: ovn4nfv-k8s-plugins-unit-tests-golang
+    builders:
+      - shell: |
+          !include-raw: ./golang-make-test.sh