Skip to content

CLOUDSTACK-9065: Packaging RPM, add option for package release version, cleanup and lint#1075

Merged
asfgit merged 1 commit into
apache:4.6from
davidamorimcruz:packaging_release_version
Nov 21, 2015
Merged

CLOUDSTACK-9065: Packaging RPM, add option for package release version, cleanup and lint#1075
asfgit merged 1 commit into
apache:4.6from
davidamorimcruz:packaging_release_version

Conversation

@davidamorimcruz
Copy link
Copy Markdown

In package.sh

  • lint
  • adjust exit codes (1 for usage, 2 for maven, 3 for rpmbuild)
  • fix variable naming for consistency
  • add option for package release version
  • revise synopsis and usage

 * lint
 * adjust exit codes (1 for usage, 2 for maven, 3 for rpmbuild)
 * variable naming consistency
 * add option for package release version
 * revise synopsis and usage
@davidamorimcruz
Copy link
Copy Markdown
Author

package.sh -d centos7 -r 3

(...)

Wrote: /root/cloudstack-packaging_release_version/dist/rpmbuild/RPMS/x86_64/cloudstack-management-4.6.0-SNAPSHOT3.el7.centos.x86_64.rpm
Wrote: /root/cloudstack-packaging_release_version/dist/rpmbuild/RPMS/x86_64/cloudstack-common-4.6.0-SNAPSHOT3.el7.centos.x86_64.rpm
Wrote: /root/cloudstack-packaging_release_version/dist/rpmbuild/RPMS/x86_64/cloudstack-agent-4.6.0-SNAPSHOT3.el7.centos.x86_64.rpm
Wrote: /root/cloudstack-packaging_release_version/dist/rpmbuild/RPMS/x86_64/cloudstack-baremetal-agent-4.6.0-SNAPSHOT3.el7.centos.x86_64.rpm
Wrote: /root/cloudstack-packaging_release_version/dist/rpmbuild/RPMS/x86_64/cloudstack-usage-4.6.0-SNAPSHOT3.el7.centos.x86_64.rpm
Wrote: /root/cloudstack-packaging_release_version/dist/rpmbuild/RPMS/x86_64/cloudstack-cli-4.6.0-SNAPSHOT3.el7.centos.x86_64.rpm

@DaanHoogland
Copy link
Copy Markdown
Contributor

code lgtm and my testing is the same as Davis so as I think we want a wide range of users to have a go at this: @wido @remibergsma @resmo @karuturi @NuxRo @bhaisaab ?

@NuxRo
Copy link
Copy Markdown
Contributor

NuxRo commented Nov 17, 2015

LGTM
I did a centos63 build and it worked as expected.

Comment thread packaging/package.sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidamorimfaria, what are the implications in giving a release number? For example, giving 4.6 or nothing will reflect in a different package or is it just for the final RPM file name?

For the looks on the code, it seems to be only the file name. :)

No big deal, I'm just curious. I will take some time to test your PR today.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick answer, the release is the versioning for the package. Not necessarily related to the content of the package. The filename is changed, and also the metadata of the RPM, in the "Release" section.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wilder,

This does not affect the contents in any way, just makes it easier to use with "yum/apt-get update" for e.g. when you want to issue updates.
It will come in handy as newer jenkins (as well as manual) built packages will now be able to gracefully upgrade old ones.
I used to fiddle around with cloud.spec to achieve the same and the idea was discussed last year with ke4qqq & spark404 but we never got anywhere. :)

Good job @davidamorimfaria !

Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----

From: "Wilder Rodrigues" notifications@github.com
To: "apache/cloudstack" cloudstack@noreply.github.com
Cc: "NuxRo" nux@li.nux.ro
Sent: Wednesday, 18 November, 2015 07:58:40
Subject: Re: [cloudstack] CLOUDSTACK-9065: Packaging RPM, add option for package release version, cleanup and lint
(#1075)

 echo ""
  • echo "Examples: ./package.sh -p|--pack oss|OSS"
  • echo " ./package.sh -p|--pack noredist|NOREDIST"
  • echo " ./package.sh (Default OSS)"
  • exit 1
  • echo "Examples: ./package.sh --pack oss"
  • echo " ./package.sh --pack noredist"
  • echo " ./package.sh --pack oss --distribution centos7 --release
    42"

@davidamorimfaria, what are the implications in giving a release number? For
example, giving 4.6 or nothing will reflect in a different package or is it
just for the final RPM file name?

For the looks on the code, it seems to be only the file name. :)

No big deal, I'm just curious. I will take some time to test your PR today.


Reply to this email directly or view it on GitHub:
https://github.com/apache/cloudstack/pull/1075/files#r45169717

@wilderrodrigues
Copy link
Copy Markdown
Contributor

Quick question: were the generated packages installed successfully?

Cheers,
Wilder

@davidamorimcruz
Copy link
Copy Markdown
Author

This is the package release version number, nothing to do with the thing that is packaged.

Its purpose is to allow for this script to be used with an automated package builder, and thus create a unique package version with each iteration, for example using a jenkins job number instead of always being "1". Also, having a distinct package version makes the package directly usable in a yum repository without having to nuke the repodata because of signature mismatches for files that were rebuild using the same name (and package version).

It is also not only the file name that is changed. If you inspect the repo you will see it in the "Release" details:

[root@CLOUD-REPO x86_64]# rpm -qip cloudstack-common-4.6.0-SNAPSHOT4.el7.centos.x86_64.rpm 
Name        : cloudstack-common
Version     : 4.6.0
Release     : SNAPSHOT4.el7.centos
Architecture: x86_64
Install Date: (not installed)
Group       : System Environment/Libraries
Size        : 112901174
License     : ASL 2.0
Signature   : (none)
Source RPM  : cloudstack-4.6.0-SNAPSHOT4.el7.centos.src.rpm
Build Date  : ma 16 nov 2015 19:00:45 UTC
Build Host  : 597e5453e780
Relocations : (not relocatable)
Packager    : Apache CloudStack <dev@cloudstack.apache.org>
Vendor      : Apache CloudStack <dev@cloudstack.apache.org>
Summary     : Apache CloudStack common files and scripts
Description :
The Apache CloudStack files shared between agent and management server
[root@CLOUD-REPO x86_64]# rpm -qip cloudstack-common-4.6.0-1.el7.centos.x86_64.rpm 
Name        : cloudstack-common
Version     : 4.6.0
Release     : 1.el7.centos
Architecture: x86_64
Install Date: (not installed)
Group       : System Environment/Libraries
Size        : 112894853
License     : ASL 2.0
Signature   : (none)
Source RPM  : cloudstack-4.6.0-1.el7.centos.src.rpm
Build Date  : di 17 nov 2015 13:22:29 UTC
Build Host  : dec63b100baa
Relocations : (not relocatable)
Packager    : Apache CloudStack <dev@cloudstack.apache.org>
Vendor      : Apache CloudStack <dev@cloudstack.apache.org>
Summary     : Apache CloudStack common files and scripts
Description :
The Apache CloudStack files shared between agent and management server

@davidamorimcruz
Copy link
Copy Markdown
Author

As for installing the package, having distinct package version numbers allows one to update packages instead of having to remove and install them in succession if they have the same version and release numbers. I haven't installed it yet, but the content should be the same, only filename and rpm metadata are modified.

@remibergsma
Copy link
Copy Markdown
Contributor

LGTM, based on a set of tests that I run on this branch. Screenshot is from an experimental Jenkins job (that runs the same tests I did manually until now). The tests were run on KVM and used the RPMs from this branch so at least those work fine and nothing else broke.

screen shot 2015-11-21 at 19 12 13

@asfgit asfgit merged commit e66dd8c into apache:4.6 Nov 21, 2015
asfgit pushed a commit that referenced this pull request Nov 21, 2015
CLOUDSTACK-9065: Packaging RPM, add option for package release version, cleanup and lintIn package.sh
 * lint
 * adjust exit codes (1 for usage, 2 for maven, 3 for rpmbuild)
 * fix variable naming for consistency
 * add option for package release version
 * revise synopsis and usage

* pr/1075:
  Refactor package.sh:  * lint  * adjust exit codes (1 for usage, 2 for maven, 3 for rpmbuild)  * variable naming consistency  * add option for package release version  * revise synopsis and usage

Signed-off-by: Remi Bergsma <github@remi.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants