From e5fb7805cf717aefa1640f0073430c7c7cd3b6dc Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 23 Jan 2019 14:05:59 +0100 Subject: [PATCH] build_utils: add a wrapper for tox in ceph-ansible This is a wrapper to be able to run scripts with tox that contain shebang with more than 127 char. Signed-off-by: Guillaume Abrioux --- ceph-ansible-prs/build/build | 2 ++ scripts/build_utils.sh | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ceph-ansible-prs/build/build b/ceph-ansible-prs/build/build index 946e2fc2..8149e622 100644 --- a/ceph-ansible-prs/build/build +++ b/ceph-ansible-prs/build/build @@ -26,6 +26,8 @@ for scenario in $scenarios; do done popd +write_exec_cmd_script + # stable-3.0 doesn't have ceph-volume and therefore doesn't support LVM scenarios. # Rather than running a bunch of conditional steps in the pipeline to check if # a PR is merging into the stable-3.0 branch, we'll just pass LVM jobs. diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 04977905..80caa146 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -850,6 +850,19 @@ write_collect_logs_playbook() { EOF } +write_exec_cmd_script() { + sudo sh -c 'cat > /home/jenkins-build/bin/exec_cmd.sh << EOF +#!/bin/bash + +script="$VENV"/"$1" + +shebang=$(head -1 "$script") +interp=( ${shebang#\#!} ) +exec "${interp[@]}" "${@}" +EOF' + sudo chmod +x /usr/local/bin/exec_cmd.sh +} + collect_ceph_logs() { # this is meant to be run in a testing scenario directory # with running vagrant vms. the ansible playbook will connect @@ -918,4 +931,4 @@ get_nr_build_jobs() { n_build_jobs=$nproc fi echo $n_build_jobs -} +} \ No newline at end of file -- 2.39.5