From fc3af983f7a74a74b332c2e99b76759e6b4e4374 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Sun, 12 Oct 2014 14:57:20 +0200 Subject: controller: create Controller script runs the script on remote machine (OpenStack), downloads the results, stores the result into its own result-database and re-generates statistics for runs done so far. It will be able to upload the results to "presenter" machine. * config.sh.template: New doc file. * controller: New file (the central script for CI). * runner/result_stats: New file. Based on downloaded results from testing machine, it generates single html file with stats. * runner/result_templates/html.tmpl: New file. Template for ^^^. --- controller | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 controller (limited to 'controller') diff --git a/controller b/controller new file mode 100755 index 0000000..938bab5 --- /dev/null +++ b/controller @@ -0,0 +1,60 @@ +#!/bin/bash + +. config.sh || { echo >&2 "sorry, but config.sh not found" ; exit 1 ; } + +# (still) local variables +distro=fedora +distro_ver=20 +arch=x86_64 +starttime=$(date -u +%Y%m%d_%H%M%S_%N) + +die() { echo "$@"; exit 1; } + +prereq_resultdir() +{ + test -d "$DTF_DATABASE" || mkdir -p "$DTF_DATABASE" +} + +unpack_results() +{ + local where="$1" + local workdir=$(mktemp -d "/tmp/.dtf.XXXXXX") || die "can not create workdir" + + pushd "$workdir" + tar -xf /var/tmp/dtf.tar.gz + + pushd dtf + for i in *.log; do + pwd + local task_id="${i%%.log}" + local mydir="" + while read dirname; do + test -z "$mydir" && mydir="$dirname" + done <<<"$(tar xvf "$task_id.tar.gz")" + + rm "$task_id.tar.gz" + + mv "$mydir" "$task_id.dir" + done + + + popd + popd + + mkdir -p "$(dirname "$where")" || die "can not create resultdir" + mv "$workdir/dtf" "$where" +} + +prereq_resultdir + +workdir=$(mktemp -d "/var/tmp/dtf_postgresql_setup-XXXXXX") + +./run_remote \ + --distro="$distro" \ + --distro-version="$distro_ver" \ + --workdir="$workdir" + +resultdir="$DTF_DATABASE/$distro/$distro_ver/$arch" +unpack_results "$resultdir/result_$starttime" + +./runner/result_stats "$resultdir" -- cgit