summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorJonathan "Duke" Leto <jonathan@leto.net>2011-01-19 13:04:42 -0800
committerJonathan "Duke" Leto <jonathan@leto.net>2011-01-19 13:04:42 -0800
commit05c0a17eabb8cb52535ca1ae30fcf8ce0906f5c3 (patch)
tree7a782c216051e366c215ad902571d34cf2939a17 /scripts
parentAttempt to fix the mangled build failure email bug (diff)
parentFix a jitterbug::Emailer test (diff)
downloadjitterbug-05c0a17eabb8cb52535ca1ae30fcf8ce0906f5c3.tar.gz
Merge branch 'refactor_builder'
Conflicts:
	config.yml
	lib/jitterbug/Builder.pm
	scripts/build-failed.sh
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-failed.sh17
-rwxr-xr-xscripts/capsule.sh69
2 files changed, 56 insertions, 30 deletions
diff --git a/scripts/build-failed.sh b/scripts/build-failed.sh
index 1be5cd2..ebd098a 100755
--- a/scripts/build-failed.sh
+++ b/scripts/build-failed.sh
@@ -1,7 +1,14 @@
 COMMITER=$1
-MESSAGE=$2
-OUTPUT=$3
-SHA=$4
-CC_EMAIL=$5
+PROJECT=$2
+MESSAGE=$3
+OUTPUT=$4
+SHA=$5
+CC_EMAIL=$6
 
-echo "Message:\n$MESSAGE\nTest Output:\n$OUTPUT\n" | mail -c "$CC_EMAIL" -s "[jitterbug] BUILD FAILED $SHA" $COMMITER
+echo "
+Message:
+$MESSAGE
+
+Test Output:
+$OUTPUT
+" | mail -c "$CC_EMAIL" -s "[jitterbug] FAIL $PROJECT @ $SHA" $COMMITER
diff --git a/scripts/capsule.sh b/scripts/capsule.sh
index 7411639..abc632d 100755
--- a/scripts/capsule.sh
+++ b/scripts/capsule.sh
@@ -3,27 +3,7 @@
 # first arg:  build_dir
 # second arg: report path
 
-builddir=$1
-report_path=$2
-
-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"
-
+function jitterbug_build () {
     if [ -f 'dist.ini' ]; then
         echo "Found dist.ini, using Dist::Zilla"
         dzil authordeps | cpanm
@@ -35,11 +15,50 @@ do
         # ./Build installdeps is not available in older Module::Build's
         cpanm --installdeps .
         HARNESS_VERBOSE=1 ./Build test --verbose >> $logfile 2>&1
-    else
-        echo "Hoping to find Makefile.PL"
+    elif [ -f 'Makefile.PL' ]; then
+        echo "Found Makefile.PL"
         perl Makefile.PL
         cpanm --installdeps .
-        make
+        HARNESS_VERBOSE=1 make test >> $logfile 2>&1
+    elif [ -f 'setup.pir' ]; then
+        echo "Found setup.pir"
+        HARNESS_VERBOSE=1 parrot setup.pir test >> $logfile 2>&1
+    elif [ -f 'setup.nqp' ]; then
+        echo "Found setup.nqp"
+        HARNESS_VERBOSE=1 parrot-nqp setup.nqp test >> $logfile 2>&1
+    elif [ -f 'Configure.pl' ]; then
+        echo "Found Configure.pl"
+        perl Configure.pl
+        cpanm --installdeps .
         HARNESS_VERBOSE=1 make test >> $logfile 2>&1
     fi
-done
+}
+
+# this is getting smelly
+builddir=$1
+report_path=$2
+perlbrew=$3
+
+echo "Creating report_path=$report_path"
+mkdir -p $report_path
+
+cd $builddir
+
+if [ $use_perlbrew ]; then
+    source $HOME/perl5/perlbrew/etc/bashrc
+    for perl in $HOME/perl5/perlbrew/perls/perl-5.*
+    do
+        theperl=$(perl -e 'print $^V')
+        logfile="$report_path/perl-$theperl.txt"
+
+        echo ">perlbrew switch $theperl"
+        perlbrew switch $theperl
+        # TODO: check error condition
+
+        jitterbug_build
+    done
+else
+        theperl=$(perl -e 'print $^V')
+        logfile="$report_path/perl-$theperl.txt"
+        jitterbug_build
+fi