diff options
-rw-r--r-- | config.yml | 2 | ||||
-rw-r--r-- | lib/jitterbug/Builder.pm | 4 | ||||
-rwxr-xr-x | scripts/capsule.sh | 37 |
3 files changed, 28 insertions, 15 deletions
diff --git a/config.yml b/config.yml index e4144c3..91e7265 100644 --- a/config.yml +++ b/config.yml @@ -18,6 +18,8 @@ jitterbug: build_process: builder: ./scripts/capsule.sh on_failure: ./scripts/build-failed.sh + options: + perlbrew: 1 plugins: DBIC: diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 72b4216..6441c0d 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -113,7 +113,9 @@ sub run_task { my $builder = $conf->{'jitterbug'}{'build_process'}{'builder'}; - my $builder_command = "$builder $build_dir $report_path"; + my $perlbrew = $conf->{'options'}{'perlbrew'} || 1; + + my $builder_command = "$builder $build_dir $report_path $perlbrew"; debug("Going to run builder : $builder_command"); my $res = `$builder_command`; diff --git a/scripts/capsule.sh b/scripts/capsule.sh index 7411639..cd102a7 100755 --- a/scripts/capsule.sh +++ b/scripts/capsule.sh @@ -3,27 +3,36 @@ # first arg: build_dir # second arg: report path +# this is getting smelly builddir=$1 report_path=$2 +perlbrew=$3 echo "Creating report_path=$report_path" mkdir -p $report_path cd $builddir -source $HOME/perl5/perlbrew/etc/bashrc - -for perl in $HOME/perl5/perlbrew/perls/perl-5.* -do - theperl="$(basename $perl)" - - echo ">perlbrew switch $theperl" - perlbrew switch $theperl - # TODO: check error condition - - perlversion=$(perl -v) - logfile="$report_path/$theperl.txt" - +if [ $use_perlbrew ]; then + source $HOME/perl5/perlbrew/etc/bashrc + for perl in $HOME/perl5/perlbrew/perls/perl-5.* + do + theperl="$(basename $perl)" + + echo ">perlbrew switch $theperl" + perlbrew switch $theperl + # TODO: check error condition + + logfile="$report_path/$theperl.txt" + jitterbug_build + done +else + theperl="$(basename perl -e \"print $]\")" + logfile="$report_path/$theperl.txt" + jitterbug_build +fi + +function jitterbug_build () { if [ -f 'dist.ini' ]; then echo "Found dist.ini, using Dist::Zilla" dzil authordeps | cpanm @@ -42,4 +51,4 @@ do make HARNESS_VERBOSE=1 make test >> $logfile 2>&1 fi -done +} |