First CI configuration refactoring interation

In order to reduce implementation efforts when adding new CI features, we want to refactor CI configuration code. See https://gitlab.com/gitlab-org/gitlab-ce/issues/15060, https://gitlab.com/gitlab-org/gitlab-ce/issues/14149

This is issue for first refactoring iteration of GitlabCiYamlProcessor and related parts of codebase.

In the first iteration we would like to:

  • Create a Gitlab::Pipeline module or use existing Gitlab::Ci.

    We can use name Gitlab::Pipeline or existing Gitlab::Ci, name to be defined.

  • Create Pipeline::Config class

    This will be initialized using contents of .gitlab-ci.yml and will represent pipeline configuration.

  • (Moved to another iteration) Create a Pipeline::Request class

    This will encapsulate stage, ref, tag, and trigger requests (we currently pass this to GitlabCiYamlProcessor to GitlabCiYamlProcessor#builds_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil).

  • Create a Pipeline::Config::Entry::Job class

    Class that will represent configuration entry for each job.

  • (Moved to another iteration) Create a Pipeline::Factory class

    Will take Config and Request instance and will be responsible for fabricating Ci::Build objects.

In next steps we will extract each configuration entry to separate class, and work on validation and CI Lint.

@ayufan what do you think about this first iteration?

/cc @markpundsack @tmaczukin