You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/05/05 17:40:13 UTC

[GitHub] khos2ow commented on a change in pull request #2627: Catch error in packagin script and fail the build

khos2ow commented on a change in pull request #2627: Catch error in packagin script and fail the build
URL: https://github.com/apache/cloudstack/pull/2627#discussion_r186267866
 
 

 ##########
 File path: packaging/package.sh
 ##########
 @@ -162,11 +162,12 @@ function packaging() {
     cp "$PWD/$DISTRO/cloud.spec" "$RPMDIR/SPECS"
 
     (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
+        (cd $PWD/../; git reset --hard)
         echo "RPM Build Failed "
         exit 3
     else
+        (cd $PWD/../; git reset --hard)
 
 Review 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.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services