Use Puppet::PUPPETVERSION to get version string#263
Use Puppet::PUPPETVERSION to get version string#263glarizza wants to merge 1 commit intopuppetlabs:2.7.xfrom
Conversation
|
So, I don't think this change is the right way to fix this. I think |
|
Spoke with Jacob and I agree with his logic. Refactoring now and will push when I'm done. |
|
Please don't merge this until I can review On Dec 8, 2011, at 19:25, Gary Larizzareply@reply.github.com wrote:
|
|
I reverted the original commit, until this can be properly reviewed and merged. Before this can be merged in my revert will need to be reverted (0022f47). |
The goal is to have our release managers build all Puppet packages
within Rake, and so this commit adds a rake task (apple_package) that
will build a DMG-encapsulated package for OS X and put it into the
pkg/apple directory off of the Puppet Root.
To accomplish this goal, a folder structure is created in
/tmp/puppet/puppet-#{version} that mirrors the structure needed for
Apple's Packagemaker CLI tool to build a package for OS X. Next, the
necessary files are copied from the Puppet source into the structure in
/tmp/puppet/puppet-#{version} and then packagemaker is run
(targeting that folder structure) to build an initial package. Hdiutil
then encapsulates that package into a DMG, and the file is finally
copied into the pkg/apple directory.
Namespace package:apple rake task
To align with the current rake workflow, the action to build an Apple
package should be namespaced under the package action. This commit does
that. Checks have also been added to ensure that the package:apple task
is run as root (which is necessary for OS X) and that the packagemaker
binary is installed (as its necessary for the task). If neither is true,
the task will fail sanely (as opposed to a stack trace).
Use git describe to get Puppet version
Using `git describe` over Puppet::PUPPETVERSION to get the current
Puppet version allows us to pull in the 'RCx' tag which can be used to
build the package. `git describe` is split on the hyphen ( - ) to remove
all the additional cruft at the end. Finally, the package minor version
splits on 'rc' since prototype.plist can only contain integers and not
string data.
Install into /usr/lib/ruby/site_ruby
In order to support 10.4 (which will be dropped in 2.8.x), we must
install puppet into /usr/lib/ruby/site_ruby/1.8 as opposed to
/Library/Ruby/Site/1.8. The prototype.plist file we bundle with the
package we create sets the IFPkgFlagFollowLinks key to true, so as long
as the symlink exists the package we build will respect it.
There IS a bug in OS X
(http://openradar.appspot.com/9202152) where the symlink in
/usr/lib/ruby/site_ruby is incorrect PRIOR to the first time the OS is
booted, but the symlink gets fixed at first boot. Users who build a
previously-unbooted-pristine-image of OS X and who also intend to
install Puppet on that image BEFORE it is booted may need to modify
their package to target /Library/Ruby/Site/1.8, however we cannot do
this at this time as OS X 10.4 DOES NOT have a /Library/Ruby/Site/1.8
folder.
Add :setup task to populate variables
There were problems with using `git describe` within a global
scope to set the @Version variable (namely that our Jenkins jobs
would try and evaluate this with custom tags that don't match our
release tags). To remedy this, the class instance variables are
now getting set in a :setup task that is getting called by the
package:apple tasks. The Jenkins jobs never attempt to run this
task and the build doesn't fail (yay!). Doing this also preserves
the 'rc' tags that we desired.
Let @Version reflect full version of git describe
The version we use for building the package should always be the
full string output by `git describe`. Because release will ALWAYS
be on a tag that isn't ahead of a commit (and thus won't be
appended by a hyphen and string data), their packages will always
be clean. For anyone else who runs the rake task, we want the
package to reflect their position in relation to a tag (which is
what `git describe` gives you).
For the @package_{major,minor}_version variables, we DO need ONLY
integers, hence the splitting on the hyphen and removing 'rc' should
it exist.
(maint) Move Puppet 2.6 and 2.7 under "Unsupported Releases" in the Release Notes
(PCP-174) Acceptance - skip un-configured service
Previously,
git describewas being used to get the puppet version,however this breaks the Jenkins builds. Puppet::PUPPETVERSION is
the better choice here (though we lose the 'rc' tags at the end).