Merge pull request #104 from MosesMendoza/maint/master/add_version_task

Add a :version task to print version
Add a utility method to load data from a yaml file

We're doing this pretty often, so in the spirit of reuse, we add a method to
handle loading yaml files.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add a Build class

This commit adds a Build class to the packaging repo. The Build class is the
beginning of a shift to using more encapsulated, easier to follow logic in
packaaging. It offers us the opportunity to track state much more easily than
before. The new Build class contains instance variables for all of the
packaging repo's many tracked data, as well as functionality to load these
variables from yaml files, return them as a hash, and most importantly, write
them back out to yaml. This will allow us to cease using a mess of environment
variables when issuing remote commands. Instead of having to constantly update
which params are sent as environment variables to remote tasks, this allows us
to send the entire state of the build object along with our desired build task,
preventing much of the trial and error of the current approach.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
assign variables to build object in 10_setupvars.rake

This commit updates 10_setupvars.rake to create a BuildInstance object and
assign our various settings to it, rather than global instance variables. We
defeated encapsulation at the origin of the packaging repo, but here it makes a
defiant return. This commit also modifies variable loading to load everything
from a yaml file we pass in the path to with the PARAMS_FILE environment
variable. This takes advantage of the BuildInstance ability to read in
attributes from a yaml file and write them back out again. We also don't need
explicit parameter setting any more for the most part, since the build object
will read in for us, but we keep the ability to override some parameters with
environment variables.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
1 to 1 mapping in params and variable names

Why I ever decided to name the instance variables something other than
their respective yaml file entries is beyond me. This commit fixes this
by replacing all instances of @name with @project, which is what it is
in the project_data.yaml file.
Update 20_setupextrasvars.rake for Build object

This commit updates the loading of extras vars in lieu of the new build
object architecture. This allows us to read in data from the extras
files as needed without worrying if specific parameters are defined or
not. The currently 'overrideable' params are still kept as such to make
sure we can still override as necessary.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Replace instance vars with build.<attr>

This commit replaces instance variable evaluations throughout the tasks
with accessor calls to the build object.
Remove environment variable passing to remote tasks

This commit adds a utility method to send the build parameters to a
remote host and return the path on the remote filesystem as a string.
This method is then used in the remote tasks to determine various
parameters required for the build. This gets us out of the business of
passing along environment variables to the remote tasks, a source of
much pain as the remote tasks have become more complex.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add DEBUG printing of all variables

This commit adds a debug parameter to the build object that we use initially to
print out all variables if passed. This can be used later as a flag for other
such behaviors as we chose.
Set instance variables for backwards compatibility
Make @name = @project for backwards compatibility

This commit also adds some more comments to 10_setupvars.rake, and tries to
standardize some formatting around comments.
Enable output dir for params write, add tasks to wrap

This commit adds tasks for printing and writing all build parameters. This
enables us to leverage this file for great purposes, such as passing into a
queuing system for builds. Printing is nice for debug.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Remove unused variables in pe sles build

We moved this data into the build-data, which means we no longer need it
defined here. We're not using it and it has no value.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Rename task loading in spec_helper

We're really loading tasks, not requiring them, so the require_task method name
is misleading. Second, hardcoding the task file extension in the method is
constraining. What if we want to load a .rb file?

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Fixup version tests to use build object

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add tests for build object

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add an instance variable for the rake args
Add ability to do a build exclusively from a params file

This last commit completely decouples the build file from the build to be
performed, allowing us to queue this with Jenkins.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>