Skip to content

Instantly share code, notes, and snippets.

@dblevins
Last active October 15, 2022 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dblevins/cba620048056e5d921b864109ee7aecc to your computer and use it in GitHub Desktop.
Save dblevins/cba620048056e5d921b864109ee7aecc to your computer and use it in GitHub Desktop.
#!/bin/bash -l
function log {
echo "LOG $(date +"%Y-%m-%d %H:%M:%S") $1"
}
function fail {
log "$1"
exit 1
}
function stats {
rm top.log
rm iostat.log
while true; do
echo "
<entry date=\"$(date +"%Y-%m-%d %H:%M:%S")\">
$(top -b -n 1)
</entry>
" >> top.log
echo "
<entry date=\"$(date +"%Y-%m-%d %H:%M:%S")\">
$(iostat)
</entry>
" >> iostat.log
sleep 30
done
}
(
source ~/.bash_profile
export MAVEN_OPTS="-Xmx4096m"
export
log "cloning tomee git repository"
rm -rf /tmp/tomee
cd /tmp &&
git clone https://github.com/apache/tomee.git &&
cd tomee || fail "Cannot clone git repository"
log "Checking out revision b0cc8f"
##
## Grab the same revision so we're all comparing the
## exact same code
##
git checkout 692a68989112c0c95c07b28bc13a0d7ebdb0cc8f
log "Performing clean build with no tests"
##
## Do a build with no tests so all binaries are downloaded
## to ensure we're not comparing network times
##
mvn clean install -DskipTests -DfailIfNoTests=false &> clean.log
log "Performing full build"
stats &
##
## Now do a full build exactly as it is done in Jenkins
## Save the results in build.log
##
mvn -U --show-version -fn clean install -Pall-adapters -Dfile.encoding=UTF-8 &> build.log
log "Run complete"
) &> ~/reboot.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment