Jenkins: Remove references to $reponame
JIRA: MADLIB-1466
With the new build job on cloudbees
https://ci-builds.apache.org/job/Madlib/, we don't need to use the
$reponame variable to access the current working directory. So this
commit removes all the references to $reponame in jenkins build script.
Also added `-j $nproc` to the `make` command to speed up the build process.
Co-authored-by: Ekta Khanna <ekhanna@vmware.com>
diff --git a/tool/jenkins/jenkins_build.sh b/tool/jenkins/jenkins_build.sh
index 3b26ac9..ab003e1 100755
--- a/tool/jenkins/jenkins_build.sh
+++ b/tool/jenkins/jenkins_build.sh
@@ -50,9 +50,9 @@
# Launch docker container with volume mounted from workdir
echo "-------------------------------"
cat <<EOF
-docker run -d -e POSTGRES_PASSWORD=postgres --name madlib -v "${workdir}/${reponame}":/madlib madlib/postgres_10:jenkins | tee logs/docker_setup.log
+docker run -d -e POSTGRES_PASSWORD=postgres --name madlib -v "${workdir}":/madlib madlib/postgres_10:jenkins | tee logs/docker_setup.log
EOF
-docker run -d -e POSTGRES_PASSWORD=postgres --name madlib -v "${workdir}/${reponame}":/madlib madlib/postgres_10:jenkins | tee logs/docker_setup.log
+docker run -d -e POSTGRES_PASSWORD=postgres --name madlib -v "${workdir}":/madlib madlib/postgres_10:jenkins | tee logs/docker_setup.log
echo "-------------------------------"
## This sleep is required since it takes a couple of seconds for the docker
@@ -69,9 +69,9 @@
echo "---------- Building package -----------"
# cmake, make, make install, and make package
cat <<EOF
-docker exec madlib bash -c 'rm -rf /build; mkdir /build; cd /build; cmake ../madlib; make clean; make; make install; make package' | tee $workdir/logs/madlib_compile.log
+docker exec madlib bash -c 'rm -rf /build; mkdir /build; cd /build; cmake ../madlib; make clean; make -j$(nproc); make -j$(nproc); make install; make package' | tee $workdir/logs/madlib_compile.log
EOF
-docker exec madlib bash -c 'rm -rf /build; mkdir /build; cd /build; cmake ../madlib; make clean; make; make install; make package' | tee $workdir/logs/madlib_compile.log
+docker exec madlib bash -c 'rm -rf /build; mkdir /build; cd /build; cmake ../madlib; make clean; make -j$(nproc); make -j$(nproc); make install; make package' | tee $workdir/logs/madlib_compile.log
echo "---------- Installing and running dev-check --------------------"
# Install MADlib and run dev check
@@ -108,6 +108,6 @@
# convert dev-check test results to junit format for reporting
cat <<EOF
-python ${reponame}/tool/jenkins/junit_export.py $workdir/logs/madlib_dev_check.log $workdir/logs/madlib_dev_check.xml
+python tool/jenkins/junit_export.py $workdir/logs/madlib_dev_check.log $workdir/logs/madlib_dev_check.xml
EOF
-python ${reponame}/tool/jenkins/junit_export.py $workdir $workdir/logs/madlib_dev_check.log $workdir/logs/madlib_dev_check.xml
+python tool/jenkins/junit_export.py $workdir $workdir/logs/madlib_dev_check.log $workdir/logs/madlib_dev_check.xml
diff --git a/tool/jenkins/rat_check.sh b/tool/jenkins/rat_check.sh
index ae30212..32b4a8d 100644
--- a/tool/jenkins/rat_check.sh
+++ b/tool/jenkins/rat_check.sh
@@ -25,13 +25,13 @@
reponame=${REPONAME:=madlib}
# Check if NOTICE file year is current
-grep "Copyright 2016-$(date +"%Y") The Apache Software Foundation" "${workdir}/${reponame}/NOTICE"
+grep "Copyright 2016-$(date +"%Y") The Apache Software Foundation" "${workdir}/NOTICE"
# Check if pom.xml file version is current
# With below grep, it's possible to get a "False Positive" (i.e. no error when it should have)
# but won't give a "False Negative" (i.e. if it fails then there's definitely a problem)
-grep "<version>$(cat "${workdir}/${reponame}/src/config/Version.yml" | cut -d" " -f2)</version>" \
- "${workdir}/${reponame}/pom.xml"
+grep "<version>$(cat "${workdir}/src/config/Version.yml" | cut -d" " -f2)</version>" \
+ "${workdir}/pom.xml"
set +x
@@ -40,7 +40,7 @@
for extension in ${badfile_extentions}; do
echo "Searching for ${extension} files:"
- badfile_count=$(find . -name "${workdir}/${reponame}/*.${extension}" | wc -l)
+ badfile_count=$(find . -name "${workdir}/*.${extension}" | wc -l)
if [ ${badfile_count} != 0 ]; then
echo "----------------------------------------------------------------------"
echo "FATAL: ${extension} files should not exist"
@@ -48,7 +48,7 @@
echo "binary (jar) files as users have a hard time verifying their"
echo "contents."
- find . -name "${workdir}/${reponame}/*.${extension}"
+ find . -name "${workdir}/*.${extension}"
echo "----------------------------------------------------------------------"
badfiles_found=true
else