jjb: Add barectf
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 9 Aug 2016 19:58:22 +0000 (15:58 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Tue, 9 Aug 2016 19:58:22 +0000 (15:58 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
jobs/barectf.yaml [new file with mode: 0644]
scripts/barectf/build.sh [new file with mode: 0755]
scripts/barectf/pylint.sh [new file with mode: 0755]

diff --git a/jobs/barectf.yaml b/jobs/barectf.yaml
new file mode 100644 (file)
index 0000000..05294ba
--- /dev/null
@@ -0,0 +1,112 @@
+- defaults:
+    name: barectf
+    description: |
+      <em><strong><a href="https://github.com/efficios/barectf">barectf</a></strong></em>
+      is a command-line utility which generates C99 code that is able to write
+      native Common Trace Format (CTF) binary streams.
+
+      <p>Job is managed by Jenkins Job Builder.</p>
+
+    project-type: freestyle
+
+    wrappers:
+      - workspace-cleanup
+      - timestamps
+      - ansicolor:
+          colormap: xterm
+  #      - credentials-binding:
+  #          - username-password-separated:
+  #              credential-id: barectf_codecov_token
+  #              username: CODECOV_PROJECT_NAME
+  #              password: CODECOV_TOKEN
+
+    scm:
+      - git:
+          url: git://github.com/{github_user}/{github_name}.git
+          browser: githubweb
+          browser-url: https://github.com/{github_user}/{github_name}
+          branches:
+            - origin/{version}
+          basedir: src/barectf
+          skip-tag: true
+
+    triggers:
+      - pollscm:
+          cron: "@hourly"
+
+    properties:
+      - build-discarder:
+          num-to-keep: 2
+      - github:
+          url: https://github.com/{github_user}/{github_name}
+
+
+## Templates
+- job-template:
+    name: barectf_{version}_build
+    defaults: barectf
+
+    project-type: matrix
+    node: 'master' # Applies only to matrix flyweight task
+    axes:
+      - axis:
+         type: slave
+         name: arch
+         values: '{obj:arch}'
+
+    builders:
+      - shell:
+         !include-raw-escape: scripts/barectf/build.sh
+
+    publishers:
+#      - archive:
+#          artifacts: 'build/**'
+#          allow-empty: false
+      - ircbot:
+          strategy: new-failure-and-fixed
+          matrix-notifier: only-parent
+          channels:
+            - name: '#lttng'
+
+
+- job-template:
+    name: barectf_{version}_pylint
+    defaults: barectf
+    node: 'x86-64'
+
+    triggers:
+      - pollscm:
+          cron: "@daily"
+
+    builders:
+       - shell:
+          !include-raw-escape: scripts/barectf/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
+
+
+## Project
+- project:
+    name: barectf
+    github_user: efficios
+    github_name: barectf
+    version:
+      - master
+    jobs:
+      - 'barectf_{version}_build':
+          arch: !!python/tuple [x86-32, x86-64]
+      - 'barectf_{version}_pylint'
+
diff --git a/scripts/barectf/build.sh b/scripts/barectf/build.sh
new file mode 100755 (executable)
index 0000000..5eafb08
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh -exu
+#
+# Copyright (C) 2015 - Michael Jeanson <mjeanson@efficios.com>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+# Has to be set in the environment
+#CODECOV_TOKEN=""
+
+SRCDIR="src/barectf"
+
+PYTHON3="python3"
+P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+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
+
+# install setuptools first
+pip install setuptools
+
+cd "$SRCDIR"
+
+# install barectf in virtual environment
+./setup.py install
+
+# test
+cd tests
+./test.bash
+
+# EOF
diff --git a/scripts/barectf/pylint.sh b/scripts/barectf/pylint.sh
new file mode 100755 (executable)
index 0000000..e142b1c
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh -exu
+#
+# Copyright (C) 2016 - Michael Jeanson <mjeanson@efficios.com>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+SRCDIR="src/barectf"
+
+PYTHON3="python3"
+P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+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
+
+cd "$SRCDIR"
+
+pep8 barectf | tee "$WORKSPACE/pep8.out"
+
+pylint -f parseable --ignore="_version.py" --disable=C0111 barectf | tee "$WORKSPACE/pylint.out"
This page took 0.025789 seconds and 4 git commands to generate.