-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All actions run before pending post-build-status-update job is run. My thought is that node-test-commit sub jobs will `curl` from master, and then pipe to bash. PR-URL: #1004 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
### | ||
# node-test-commit-pre | ||
# All actions run before pending post-build-status-update job is run | ||
### | ||
|
||
# Git | ||
git --version | ||
|
||
# Name and email in git config need to be the same across all jobs | ||
# so that git rebase --committer-date-is-author-date will produce | ||
# the same commit SHA1 | ||
git config --replace-all user.name Dummy | ||
git config --replace-all user.email dummy@dummy.com | ||
git config user.name | ||
git config user.email | ||
echo $GIT_COMMITTER_NAME | ||
echo $GIT_AUTHOR_NAME | ||
|
||
git rebase --abort || true | ||
git checkout -f refs/remotes/origin/_jenkins_local_branch | ||
git config user.name | ||
git config user.email | ||
echo $GIT_COMMITTER_NAME | ||
echo $GIT_AUTHOR_NAME | ||
|
||
git status | ||
git rev-parse HEAD | ||
git rev-parse $REBASE_ONTO | ||
|
||
if [ -n "${REBASE_ONTO}" ]; then | ||
git rebase --committer-date-is-author-date $REBASE_ONTO | ||
fi | ||
|
||
if [ -n "${POST_REBASE_SHA1_CHECK}" ]; then | ||
check_sha1=${POST_REBASE_SHA1_CHECK} | ||
head_sha1=$(git rev-parse HEAD) | ||
if [ "$head_sha1" != "$check_sha1" ]; then | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Diagnostics | ||
set +x | ||
DIAGFILE=${HOME}/jenkins_diagnostics.txt | ||
echo >> ${DIAGFILE} | ||
echo >> ${DIAGFILE} | ||
echo >> ${DIAGFILE} | ||
TS="`date`" | ||
echo $TS | ||
echo $TS >> ${DIAGFILE} | ||
echo "Before building" >> ${DIAGFILE} | ||
echo $BUILD_TAG >> ${DIAGFILE} | ||
echo $BUILD_URL >> ${DIAGFILE} | ||
echo $NODE_NAME >> ${DIAGFILE} | ||
echo >> ${DIAGFILE} | ||
echo "netstat -anp" >> ${DIAGFILE} | ||
netstat -anp >> ${DIAGFILE} 2>&1 || true | ||
echo >> ${DIAGFILE} | ||
echo "netstat -gn" >> ${DIAGFILE} | ||
netstat -gn >> ${DIAGFILE} 2>&1 || true | ||
echo >> ${DIAGFILE} | ||
echo "ps auxww" >> ${DIAGFILE} | ||
ps auxww >> ${DIAGFILE} 2>&1 || true | ||
mv ${DIAGFILE} ${DIAGFILE}-OLD || true | ||
tail -c 20000000 ${DIAGFILE}-OLD > ${DIAGFILE} || true | ||
rm ${DIAGFILE}-OLD || true | ||
set -x | ||
pgrep node || true |