Add a hardcoded f18 destination, because that's how we roll

Adding f18 to the mocks to build with caused problems because now f18 packages
have no destination to be written to. This commit applies a bandaid to the
gangrenous arm that is the setup of the mock config. There will be a more
robust solution later today.
Merge pull request #106 from haus/gangrene

Add a hardcoded f18 destination, because that's how we roll
Remove setup_el_dirs method

The setup_el_dirs task used hardcoded paths to make directories in advance of
mocking the packages. This was fragile and prone to breakage. This commit moves
the directory creation into the build_rpm_with_mock method where the current
destination is known and can be created before any copying happens.
Merge pull request #107 from haus/setup_dirs_fix

Remove setup_el_dirs method
(maint) Add parens to cp calls
Remove setup_el_dirs dependency in pe_sles task

Previously the sles rake task depended on setup_el_dirs as defined in
mock.rake. This commit makes a similar fix to the mock fix, by making
directories immediately before copying/linking into them so that the pathing is
known and directories can be created.
Merge pull request #108 from haus/remove_setup_el_dirs

Remove setup el dirs
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>