Merge "Set wget to quiet mode to hide Maven DL output"
authorThanh Ha <thanh.ha@linuxfoundation.org>
Sun, 11 Jun 2017 16:11:23 +0000 (16:11 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Sun, 11 Jun 2017 16:11:23 +0000 (16:11 +0000)
.coafile
README.md
jjb/lf-ci-jobs.yaml
jjb/lf-macros.yaml
shell/lftools-install.sh
shell/sysstat.sh [new file with mode: 0644]

index 291c200..340ef8b 100644 (file)
--- a/.coafile
+++ b/.coafile
@@ -1,6 +1,3 @@
-[Default]
-ignore = .*/**
-
 [GitCommit]
 bears = GitCommitBear
 ignore_length_regex = Signed-off-by,
@@ -12,12 +9,14 @@ ignore_length_regex = Signed-off-by,
 [YAML]
 bears = YAMLLintBear
 files = **/*.yaml
+ignore = .*/**
 document_start = True
 yamllint_config = yamllint.conf
 
 [ShellCheck]
 bears = ShellCheckBear,SpaceConsistencyBear
 files = **/*.sh
+ignore = .*/**
 shell = bash
 indent_size = 4
 use_spaces = yeah
index 6c68417..61b8739 100644 (file)
--- a/README.md
+++ b/README.md
@@ -11,11 +11,15 @@ For example:
 
 ```
 GIT_URL=ssh://jenkins-$SILO@git.opendaylight.org:29418
+GIT_CLONE_URL=git@github.com:
 JENKINS_HOSTNAME=jenkins092
 LOGS_SERVER=https://logs.opendaylight.org
 NEXUS_URL=https://nexus.opendaylight.org
 SILO=releng
 ```
+Note: **GIT_CLONE_URL** is only used by Github projects as this
+will be different from the URL used the poperties
+configuration.
 
 ## Jenkins Plugin Requirements
 
@@ -74,11 +78,9 @@ Trigger global configuration.
 **jenkins-ssh-credential**: The name of the Jenkins Credential to use for ssh
 connections.
 
-If you are using GitHub then there are two more parameters which
+If you are using GitHub then there is one more parameter which
 will need to be placed in the defaults.yaml
 
-**github-url**: The URL of GitHub. (Default: https://github.com)
-
 **github-org**: The name of the GitHub organization.
 
 defaults.yaml:
index e32b1db..b5f45dc 100644 (file)
     # yamllint disable-line rule:key-duplicates
     <<: *lf_jjb_merge_builders
 
-    ######################
-    # Default parameters #
-    ######################
-
-    github-url: https://github.com
-
     #####################
     # Job Configuration #
     #####################
 
     properties:
       - github:
-          url: '{github-url}/{github-org}/{project}'
+          url: '${{GIT_URL}}{github-org}/{project}'
 
     scm:
       - lf-infra-github-scm:
-          url: 'git@github.com:{github-org}/{project}'
+          url: '${{GIT_CLONE_URL}}{github-org}/{project}'
           refspec: ''
           branch: '{branch}'
           submodule-recursive: '{submodule-recursive}'
     # yamllint disable-line rule:key-duplicates
     <<: *lf_jjb_merge_builders
 
-    ######################
-    # Default parameters #
-    ######################
-
-    github-url: https://github.com
-
     #####################
     # Job Configuration #
     #####################
 
     properties:
       - github:
-          url: '{github-url}/{github-org}/{project}'
+          url: '${{GIT_URL}}{github-org}/{project}'
 
     scm:
       - lf-infra-github-scm:
-          url: 'git@github.com:{github-org}/{project}'
+          url: '${{GIT_CLONE_URL}}{github-org}/{project}'
           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
           branch: '{branch}'
           submodule-recursive: '{submodule-recursive}'
index 6191dca..dcd79d3 100644 (file)
       - description-setter:
           regexp: '^Build logs: .*'
 
+- builder:
+    name: lf-infra-sysstat
+    builders:
+      - shell: !include-raw:
+          - ../shell/sysstat.sh
+
 - builder:
     name: lf-jacoco-nojava-workaround
     builders:
     publishers:
       - postbuildscript:
           builders:
+            - lf-infra-sysstat
             - lf-infra-ship-logs
           script-only-if-succeeded: false
           script-only-if-failed: false
index cebb0a5..8b1c8f1 100644 (file)
@@ -19,8 +19,10 @@ virtualenv --quiet "$WORKSPACE/.virtualenvs/lftools"
 source "$WORKSPACE/.virtualenvs/lftools/bin/activate"
 PYTHON="$WORKSPACE/.virtualenvs/lftools/bin/python"
 $PYTHON -m pip install --quiet --upgrade pip
-$PYTHON -m pip install --quiet --upgrade pipdeptree
 $PYTHON -m pip install --quiet --upgrade "lftools<1.0.0"
 
-echo "----> Pip Dependency Tree"
-$PYTHON -m pipdeptree
+# pipdeptree prints out a lot of information because lftools pulls in many
+# dependencies. Let's only print it if we want to debug.
+# echo "----> Pip Dependency Tree"
+# $PYTHON -m pip install --quiet --upgrade pipdeptree
+# $PYTHON -m pipdeptree
diff --git a/shell/sysstat.sh b/shell/sysstat.sh
new file mode 100644 (file)
index 0000000..022374a
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+# @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
+##############################################################################
+# Copyright (c) 2017 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+echo "---> sysstat.sh"
+set +e  # DON'T fail build if script fails.
+
+OS=$(facter operatingsystem)
+case "$OS" in
+    Ubuntu)
+        SYSSTAT_PATH="/var/log/sysstat"
+    ;;
+    CentOS|RedHat)
+        SYSSTAT_PATH="/var/log/sa"
+    ;;
+    *)
+        # nothing to do
+        exit 0
+    ;;
+esac
+
+SAR_DIR="$WORKSPACE/archives/sar-reports"
+mkdir -p "$SAR_DIR"
+cp "$SYSSTAT_PATH/"* $_
+# convert sar data to ascii format
+while IFS="" read -r s
+do
+    [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/"sar${s//[!0-9]/}
+done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
+
+# DON'T fail build if script fails.
+exit 0