Catch error in packagin script and fail the build#2627
Conversation
| echo "RPM Build Failed " | ||
| exit 3 | ||
| else | ||
| (cd $PWD/../; git reset --hard) |
There was a problem hiding this comment.
Should the git reset --hard be part of the packaging script at all?
There was a problem hiding this comment.
Technically yes, because if --use-timestamp is used actual POM versions are changed and to leave the working directory in pristine state it's needed.
There was a problem hiding this comment.
I would prefer to remove it, especially if someone is working on their feature/bugfix branch it risks removing changes (and losing code).
There was a problem hiding this comment.
That's actually a good point, I'll add an extra if condition around it later.
27fc4d1 to
0a5ef3a
Compare
| (cd "$RPMDIR"; rpmbuild --define "_topdir ${RPMDIR}" "${DEFVER}" "${DEFFULLVER}" "${DEFREL}" ${DEFPRE+"$DEFPRE"} ${DEFOSSNOSS+"$DEFOSSNOSS"} ${DEFSIM+"$DEFSIM"} -bb SPECS/cloud.spec) | ||
| (cd $PWD/../; git reset --hard) | ||
| if [ $? -ne 0 ]; then | ||
| if [ "$USE_TIMESTAMP" == "true" ]; then |
There was a problem hiding this comment.
What is the default of USE_TIMESTAMP? false?
There was a problem hiding this comment.
Yes, defined on line 185.
This is to fix the regression added in apache#2433. In this fix we're going to fail the build early if --use-timestamp is provided and working directory is *not* clean.
0a5ef3a to
38f74ac
Compare
|
@blueorangutan package |
|
@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2032 |
Description
This PR is going to:
--use-timestampis provided and working directory is not clean.Types of changes
GitHub Issue/PRs
Screenshots (if appropriate):
How Has This Been Tested?
Checklist:
Testing