From: Michael Jeanson Date: Thu, 3 Sep 2015 20:31:22 +0000 (-0400) Subject: Added lttng-analyses job X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ead62c96a4d0ecd27c8573eb7ca7e06b9f66e533;p=lttng-ci.git Added lttng-analyses job --- diff --git a/jobs/lttng-analyses.yaml b/jobs/lttng-analyses.yaml new file mode 100644 index 0000000..bf9511b --- /dev/null +++ b/jobs/lttng-analyses.yaml @@ -0,0 +1,86 @@ +- defaults: + name: lttng-analyses + description: | + LTTng analyses python scripts. + +

Job is managed by Jenkins Job Builder.

+ + project-type: freestyle + + logrotate: + daysToKeep: -1 + numToKeep: 2 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + wrappers: + - workspace-cleanup + - timestamps + - ansicolor: + colormap: xterm + + scm: + - git: + url: git://github.com/lttng/lttng-analyses.git + browser: githubweb + browser-url: https://github.com/lttng/lttng-analyses + branches: + - origin/{version} + + triggers: + - pollscm: + cron: "@hourly" + + properties: + - github: + url: https://github.com/lttng/lttng-analyses + + +## Templates +- job-template: + name: lttng-analyses_{version}_pylint + defaults: lttng-analyses + node: 'x86-64' + + triggers: + - pollscm: + cron: "@daily" + + builders: + - copyartifact: + project: babeltrace-master/arch=x86-64,build=std,conf=python_bindings + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/babeltrace' + - shell: + !include-raw-escape scripts/lttng-analyses/pylint.sh + + publishers: + - archive: + artifacts: 'pep8.out,pylint.out' + - violations: + pep8: + pattern: pep8.out + min: 10 + max: 999 + unstable: 999 + pylint: + pattern: pylint.out + min: 10 + max: 999 + unstable: 999 + - email: + recipients: 'ci-notification@lists.lttng.org' + notify-every-unstable-build: true + send-to-individuals: false + + +## Project +- project: + name: lttng-analyses + version: + - master + jobs: + - 'lttng-analyses_{version}_pylint' + diff --git a/scripts/lttng-analyses/pylint.sh b/scripts/lttng-analyses/pylint.sh new file mode 100644 index 0000000..334cda5 --- /dev/null +++ b/scripts/lttng-analyses/pylint.sh @@ -0,0 +1,43 @@ +#!/bin/sh -exu +# +# Copyright (C) 2015 - Michael Jeanson +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +BABELTRACE_DIR=$WORKSPACE/deps/babeltrace/build + +export LD_LIBRARY_PATH="$BABELTRACE_DIR/lib" +export PYTHONPATH="$BABELTRACE_DIR/python3.4/dist-packages/" + +PYENV_HOME=$WORKSPACE/.pyenv/ + +# Delete previously built virtualenv +if [ -d $PYENV_HOME ]; then + rm -rf $PYENV_HOME +fi + +# Create virtualenv and install necessary packages +virtualenv --system-site-packages -p python3 $PYENV_HOME + +set +u +. $PYENV_HOME/bin/activate +set -u + +pip install --quiet pylint +pip install --quiet pep8 + +pep8 lttnganalyses | tee pep8.out + +pylint -f parseable --ignore="_version.py" lttnganalyses | tee pylint.out