Catch error in packagin script and fail the build#2627
Catch error in packagin script and fail the build#2627yadvr merged 1 commit intoapache:masterapache/cloudstack:masterfrom khos2ow:catch-packaging-errorkhos2ow/cloudstack:catch-packaging-errorCopy head branch name to clipboard
Conversation
packaging/package.sh
Outdated
| 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 |
CLOUDSTACK-10268: Fix and enhance package script (apache#2433) - new flag `-T, --use-timestamp` to use `timestamp` when POM version contains SNAPSHOT - in the final artifacts (jar) name - in the final package (rpm, deb) name - in `/etc/cloudstack-release` file of SystemVMs - in the Management Server > About dialog - if there's a "branding" string in the POM version (e.g. `x.y.z.a-NAME[-SNAPSHOT]`), the branding name will be used in the final generated pacakge name such as following: - `cloudstack-management-x.y.z.a-NAME.NUMBER.el7.centos.x86_64` - `cloudstack-management_x.y.z.a-NAME-NUMBER~xenial_all.deb` - branding string can be overriden with newly added `-b, --brand` flag - handle the new format version for VR version - fix long opts (they were broken) - tolerate and show a warning message for unrecognized flags - usage help reformat * Deprecate Version class in favor or CloudStackVersion CLOUDSTACK-10268: Fix typo (apache#2495) This fixes typo introduced in PR apache#2433 packaging: Catch error in packaging script and fail the build (apache#2627) 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. chrry pick packaging: Catch error in packaging script and fail the build (apache#2627) 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. fix patch delete unused files
CLOUDSTACK-10268: Fix and enhance package script (apache#2433) - new flag `-T, --use-timestamp` to use `timestamp` when POM version contains SNAPSHOT - in the final artifacts (jar) name - in the final package (rpm, deb) name - in `/etc/cloudstack-release` file of SystemVMs - in the Management Server > About dialog - if there's a "branding" string in the POM version (e.g. `x.y.z.a-NAME[-SNAPSHOT]`), the branding name will be used in the final generated pacakge name such as following: - `cloudstack-management-x.y.z.a-NAME.NUMBER.el7.centos.x86_64` - `cloudstack-management_x.y.z.a-NAME-NUMBER~xenial_all.deb` - branding string can be overriden with newly added `-b, --brand` flag - handle the new format version for VR version - fix long opts (they were broken) - tolerate and show a warning message for unrecognized flags - usage help reformat * Deprecate Version class in favor or CloudStackVersion CLOUDSTACK-10268: Fix typo (apache#2495) This fixes typo introduced in PR apache#2433 packaging: Catch error in packaging script and fail the build (apache#2627) 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. packaging: Catch error in packaging script and fail the build (apache#2627) 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. fix patch delete unused files create version 4.11.3.0-scclouds1
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