jjb: lttng-tools: Add release jobs
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 20 May 2020 19:26:44 +0000 (15:26 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Wed, 20 May 2020 19:26:44 +0000 (15:26 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
jobs/lttng-tools.yaml
scripts/lttng-tools/release.sh [new file with mode: 0644]

index 335d5b8097f24aae726f36f2f0dac1ee79d38dc2..a9c0c59aa3391cb2ea39fe5ce0d3e7e579b0bda7 100644 (file)
           clean-if:
             - failure: false
 
+- job-template:
+    name: lttng-tools_{version}_release
+    defaults: lttng-tools
+    node: 'amd64'
+
+    triggers:
+      - pollscm:
+          cron: "@daily"
+
+    scm:
+      - git:
+          url: git://github.com/{github_user}/{github_name}.git
+          browser: githubweb
+          browser-url: https://github.com/{github_user}/{github_name}
+          branches:
+            - '*/tags/{version}.*'
+          basedir: src/lttng-tools
+
+    builders:
+      - copyartifact:
+          project: liburcu_{urcuversion}_build/arch=amd64,conf=std,build=std
+          which-build: last-successful
+          stable: false
+          filter: 'build/**'
+          target: 'deps'
+          do-not-fingerprint: true
+      - copyartifact:
+          project: babeltrace_{babelversion}_build/arch=amd64,conf=std,build=std
+          which-build: last-successful
+          stable: false
+          filter: 'build/**'
+          target: 'deps'
+          do-not-fingerprint: true
+      - copyartifact:
+          project: lttng-ust_{ustversion}_build/liburcu_version={urcuversion},arch=amd64,conf=agents,build=std
+          which-build: last-successful
+          stable: false
+          filter: 'build/**'
+          target: 'deps'
+          do-not-fingerprint: true
+      - shell:
+          !include-raw-escape: scripts/lttng-tools/clean_processes_coredump.sh
+      - shell:
+          !include-raw-escape: scripts/lttng-tools/release.sh
+
+    publishers:
+      - postbuildscript:
+          mark-unstable-if-failed: true
+          builders:
+            - role: SLAVE
+              build-on:
+                  - SUCCESS
+                  - UNSTABLE
+                  - NOT_BUILT
+                  - ABORTED
+                  - FAILURE
+              build-steps:
+                  - shell:
+                      !include-raw-escape: scripts/lttng-tools/hang_processes.sh
+      - warnings:
+          console-log-parsers:
+            - 'GNU Make + GNU C Compiler (gcc)'
+          total-thresholds:
+            unstable:
+              total-all: 0
+              total-high: 0
+              total-normal: 0
+              total-low: 0
+      - workspace-cleanup:
+          clean-if:
+            - failure: false
+      - archive:
+          artifacts: 'out/**'
+          allow-empty: false
+
 - job-template:
     name: lttng-tools_{version}_cppcheck
     defaults: lttng-tools
           babelversion: !!python/tuple [stable-2.0]
           testtype: !!python/tuple [full]
           filter: ''
+      - 'lttng-tools_{version}_release':
+          version: v2.12
+          ustversion: stable-2.12
+          urcuversion: stable-0.12
+          babelversion: stable-2.0
 
       # stable-2.11
       - 'lttng-tools_{version}_{buildtype}':
           babelversion: !!python/tuple [stable-1.5]
           testtype: !!python/tuple [full]
           filter: ''
+      - 'lttng-tools_{version}_release':
+          version: v2.11
+          ustversion: stable-2.11
+          urcuversion: stable-0.10
+          babelversion: stable-1.5
 
       # stable-2.10
       - 'lttng-tools_{version}_{buildtype}':
           babelversion: !!python/tuple [stable-1.5]
           testtype: !!python/tuple [full]
           filter: ''
+      - 'lttng-tools_{version}_release':
+          version: v2.10
+          ustversion: stable-2.10
+          urcuversion: stable-0.9
+          babelversion: stable-1.5
 
       # stable-2.9 #
       - 'lttng-tools_{version}_{buildtype}':
diff --git a/scripts/lttng-tools/release.sh b/scripts/lttng-tools/release.sh
new file mode 100644 (file)
index 0000000..a2b61ca
--- /dev/null
@@ -0,0 +1,197 @@
+#!/bin/bash -exu
+#
+# Copyright (C) 2015 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
+# Copyright (C) 2020 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/>.
+
+# Version compare functions
+vercomp () {
+    set +u
+    if [[ "$1" == "$2" ]]; then
+        return 0
+    fi
+    local IFS=.
+    local i ver1=($1) ver2=($2)
+    # fill empty fields in ver1 with zeros
+    for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do
+        ver1[i]=0
+    done
+    for ((i=0; i<${#ver1[@]}; i++)); do
+        if [[ -z ${ver2[i]} ]]; then
+            # fill empty fields in ver2 with zeros
+            ver2[i]=0
+        fi
+        if ((10#${ver1[i]} > 10#${ver2[i]})); then
+            return 1
+        fi
+        if ((10#${ver1[i]} < 10#${ver2[i]})); then
+            return 2
+        fi
+    done
+    set -u
+    return 0
+}
+
+verlte() {
+    vercomp "$1" "$2"; local res="$?"
+    [ "$res" -eq "0" ] || [ "$res" -eq "2" ]
+}
+
+verlt() {
+    vercomp "$1" "$2"; local res="$?"
+    [ "$res" -eq "2" ]
+}
+
+vergte() {
+    vercomp "$1" "$2"; local res="$?"
+    [ "$res" -eq "0" ] || [ "$res" -eq "1" ]
+}
+
+vergt() {
+    vercomp "$1" "$2"; local res="$?"
+    [ "$res" -eq "1" ]
+}
+
+verne() {
+    vercomp "$1" "$2"; local res="$?"
+    [ "$res" -ne "0" ]
+}
+
+export TERM="xterm-256color"
+
+DEPS_INC="$WORKSPACE/deps/build/include"
+DEPS_LIB="$WORKSPACE/deps/build/lib"
+DEPS_PKGCONFIG="$DEPS_LIB/pkgconfig"
+DEPS_BIN="$WORKSPACE/deps/build/bin"
+DEPS_JAVA="$WORKSPACE/deps/build/share/java"
+
+export PATH="$DEPS_BIN:$PATH"
+export LD_LIBRARY_PATH="$DEPS_LIB:${LD_LIBRARY_PATH:-}"
+export PKG_CONFIG_PATH="$DEPS_PKGCONFIG"
+export CPPFLAGS="-I$DEPS_INC"
+export LDFLAGS="-L$DEPS_LIB"
+
+export JAVA_HOME="/usr/lib/jvm/default-java"
+export CLASSPATH="$DEPS_JAVA/*:/usr/share/java/*"
+
+SRCDIR="$WORKSPACE/src/lttng-tools"
+TAPDIR="$WORKSPACE/tap"
+PREFIX="$WORKSPACE/out"
+
+# Create tmp directory
+TMPDIR="$WORKSPACE/tmp"
+mkdir -p "$TMPDIR"
+
+# Use a symlink in /tmp to point to the the tmp directory
+# inside the workspace, this is to work around the path length
+# limit of unix sockets which are created by the test suite.
+tmpdir="$(mktemp)"
+ln -sf "$TMPDIR" "$tmpdir"
+export TMPDIR="$tmpdir"
+
+# Create a symlink to "babeltrace" when the "babeltrace2" executable is found.
+# This is a temporary workaround until lttng-tools either allows the override of
+# the trace reader in its test suite or that we move to only supporting
+# babeltrace2
+if [ -x "$DEPS_BIN/babeltrace2" ]; then
+       ln -s "$DEPS_BIN/babeltrace2" "$DEPS_BIN/babeltrace"
+fi
+
+# When using babeltrace2 make sure that it finds its plugins and
+# plugin-providers.
+export BABELTRACE_PLUGIN_PATH="$DEPS_LIB/babeltrace2/plugins/"
+export LIBBABELTRACE2_PLUGIN_PROVIDER_DIR="$DEPS_LIB/babeltrace2/plugin-providers/"
+
+PYTHON2=python2
+PYTHON3=python3
+
+# Set default python to python3 for the bindings
+export PYTHON="$PYTHON3"
+export PYTHON_CONFIG="/usr/bin/$PYTHON3-config"
+
+P2_VERSION=$($PYTHON2 -c "import sys;print(sys.version[:3])")
+P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+
+UST_PYTHON2="$WORKSPACE/deps/build/lib/python$P2_VERSION/site-packages"
+UST_PYTHON3="$WORKSPACE/deps/build/lib/python$P3_VERSION/site-packages"
+
+export PYTHONPATH="$UST_PYTHON2:$UST_PYTHON3"
+
+
+
+# Create build and tmp directories
+rm -rf "$PREFIX"
+mkdir -p "$PREFIX"
+
+
+
+
+# Enter the source directory
+cd "$SRCDIR"
+
+# Run bootstrap in the source directory prior to configure
+./bootstrap
+
+# Get source version from configure script
+eval "$(grep '^PACKAGE_VERSION=' ./configure)"
+
+TARBALL_FILE="lttng-tools-$PACKAGE_VERSION.tar.bz2"
+
+# Make sure the reported version matches the current git tag
+GIT_TAG="$(git describe --exact-match --tags $(git log -n1 --pretty='%h')|| echo 'undefined')"
+
+if [ "v$PACKAGE_VERSION" != "$GIT_TAG" ]; then
+  echo "Git checkout is not tagged or doesn't match the reported version."
+  exit 1
+fi
+
+# Generate release tarball
+./configure
+make dist
+cp "./$TARBALL_FILE" "$PREFIX/"
+
+
+# Allow core dumps
+ulimit -c unlimited
+
+# Force the lttng-sessiond path to /bin/true to prevent the spawing of a
+# lttng-sessiond --daemonize on "lttng create"
+export LTTNG_SESSIOND_PATH="/bin/true"
+
+
+# Do an in-tree test build
+mkdir "$WORKSPACE/intree"
+cd "$WORKSPACE/intree" || exit 1
+tar xvf "$PREFIX/$TARBALL_FILE" --strip 1
+./configure --prefix="$(mktemp -d)" --enable-python-bindings --enable-test-java-agent-all --enable-test-python-agent-all
+make -j "$(nproc)" V=1
+make check
+make install
+make clean
+
+# do an out-of-tree test build
+mkdir "$WORKSPACE/oot"
+mkdir "$WORKSPACE/oot/src"
+mkdir "$WORKSPACE/oot/build"
+cd "$WORKSPACE/oot/src" || exit 1
+tar xvf "$PREFIX/$TARBALL_FILE" --strip 1
+cd "$WORKSPACE/oot/build" || exit 1
+"$WORKSPACE/oot/src/configure" --prefix="$(mktemp -d)" --enable-python-bindings --enable-test-java-agent-all --enable-test-python-agent-all
+make -j "$(nproc)" V=1
+make check
+make install
+make clean
+
+# EOF
This page took 0.027901 seconds and 4 git commands to generate.