xci sfc: Enable post merge deployment 17/50917/2
authorFatih Degirmenci <fdegir@gmail.com>
Mon, 22 Jan 2018 09:27:40 +0000 (10:27 +0100)
committerFatih Degirmenci <fdegir@gmail.com>
Mon, 22 Jan 2018 09:36:31 +0000 (10:36 +0100)
This change enables the deployment upon merge of a change.
Followup patches will incorporate functest smoke and promotion
which the promotion will most likely be the first one as functest
parts are a bit tricky due to failures while running testing
in VMs.

Apart from the enablement of the deployments, job concurrency is
disabled as well since we should only test one change at a time
and attempt promotion for any scenario in order to ensure we keep
the promotion consistent.

Change-Id: Ib4b5754b6b88f42eab83c656e03773c83068016f
Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
jjb/xci/xci-merge-jobs.yml
jjb/xci/xci-promote.sh [new file with mode: 0755]

index d96956e..df03a04 100644 (file)
@@ -52,7 +52,7 @@
 
     disabled: '{obj:disabled}'
 
-    concurrent: true
+    concurrent: false
 
     properties:
       - logrotate-default
             - 'xci-osa-periodic-{distro}-.*'
             - 'xci-(os|k8s).*?-virtual-{distro}-.*'
           block-level: 'NODE'
-      - throttle:
-          max-per-node: 2
-          max-total: 10
-          categories:
-            - xci-verify-virtual
-          option: category
 
     wrappers:
       - ssh-agent-wrapper
 - builder:
     name: 'xci-merge-deploy-macro'
     builders:
-      - shell: |
-          #!/bin/bash
-
-          echo "Hello World!"
+      - shell:
+          !include-raw: ./xci-start-new-vm.sh
+      - shell:
+          !include-raw: ./xci-start-deployment.sh
 
 - builder:
     name: 'xci-merge-healthcheck-macro'
     builders:
-      - shell: |
-          #!/bin/bash
-
-          echo "Hello World!"
+      - shell:
+          !include-raw: ./xci-run-functest.sh
+      - shell:
+          !include-raw: ./xci-cleanup.sh
 
 - builder:
     name: 'xci-merge-promote-macro'
     builders:
-      - shell: |
-          #!/bin/bash
-
-          echo "Hello World!"
+      - shell:
+          !include-raw: ./xci-promote.sh
diff --git a/jjb/xci/xci-promote.sh b/jjb/xci/xci-promote.sh
new file mode 100755 (executable)
index 0000000..b164089
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 Ericsson 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
+##############################################################################
+
+#----------------------------------------------------------------------
+# This script is used by CI and executed by Jenkins jobs.
+# You are not supposed to use this script manually if you don't know
+# what you are doing.
+#----------------------------------------------------------------------
+
+# skip the healthcheck if the patch doesn't impact the deployment
+if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then
+    echo "Skipping the healthcheck!"
+    exit 0
+fi
+
+echo "Hello World!"