Skip to content

Commit

Permalink
Added CI script functionality to build an SPI PR
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjenkinson committed Oct 19, 2016
1 parent 2c948bd commit 6585d4b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/hudson/narayana.bat
Expand Up @@ -2,6 +2,8 @@ if not defined WORKSPACE (call:fail_build & exit -1)

call:comment_on_pull "Started testing this pull request on Windows: %BUILD_URL%"

call:build_spi_pr

call build.bat clean install %* || (call:comment_on_pull "Windows - Narayana Failed %BUILD_URL%" & exit -1)

call:comment_on_pull "Windows - Job complete %BUILD_URL%"
Expand All @@ -12,6 +14,19 @@ rem ------------------------------------------------------

goto:eof

:build_spi_pr
if "%SPI_BRANCH%"=="" goto:eof

echo "Cloning SPI"
rmdir /S /Q jboss-transaction-spi
git clone https://github.com/jbosstm/jboss-transaction-spi.git || (call:comment_on_pull "SPI clone Failed %BUILD_URL%" & exit -1)
cd jboss-transaction-spi
if defined SPI_BRANCH git fetch origin +refs/pull/*/head:refs/remotes/jbosstm/pull/*/head & git checkout %SPI_BRANCH%
if %ERRORLEVEL% NEQ 0 exit -1
cd ..
call build.bat clean install "-f" "jboss-transaction-spi\pom.xml" || (call:comment_on_pull "SPI build Failed %BUILD_URL%" & exit -1)
goto:eof

:fail_build
call:comment_on_pull "Build failed %BUILD_URL%"
tasklist & FOR /F "usebackq tokens=5" %%i in (`"netstat -ano|findstr 9990.*LISTENING"`) DO taskkill /F /PID %%i
Expand Down
18 changes: 18 additions & 0 deletions scripts/hudson/narayana.sh
Expand Up @@ -202,6 +202,24 @@ function kill_qa_suite_processes
}

function build_narayana {
echo "Checking if need SPI PR"
if [ -n "$SPI_BRANCH" ]; then
echo "Building SPI PR"
if [ -d jboss-transaction-spi ]; then
rm -rf jboss-transaction-spi
fi
git clone https://github.com/jbosstm/jboss-transaction-spi.git -o jbosstm
[ $? = 0 ] || fatal "git clone https://github.com/jbosstm/jboss-transaction-spi.git failed"
cd jboss-transaction-spi
git fetch jbosstm +refs/pull/*/head:refs/remotes/jbosstm/pull/*/head
[ $? = 0 ] || fatal "git fetch of pulls failed"
git checkout $SPI_BRANCH
[ $? = 0 ] || fatal "git fetch of pull branch failed"
cd ../
./build.sh -f jboss-transaction-spi/pom.xml clean install
[ $? = 0 ] || fatal "Build of SPI failed"
fi

echo "Building Narayana"
cd $WORKSPACE

Expand Down

0 comments on commit 6585d4b

Please sign in to comment.