Module: Codepipe::Dsl::Pipeline::Codebuild
- Included in:
- Codepipe::Dsl::Pipeline
- Defined in:
- lib/codepipe/dsl/pipeline/codebuild.rb
Instance Method Summary collapse
Instance Method Details
#codebuild(*projects) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/codepipe/dsl/pipeline/codebuild.rb', line 3 def codebuild(*projects) default = { # name: '', # will be set action_type_id: { category: "Build", owner: "AWS", provider: "CodeBuild", version: "1", }, run_order: @run_order, # configuration: { project_name: '' }, # will be set # output_artifacts: [name: "BuildArtifact#{name}"], # TODO: maybe make this configurable with a setting input_artifacts: [name: "SourceArtifact"], } actions = projects.map do |item| if item.is_a?(String) name = item.underscore.camelize project_name = adjusted_project_name(item) # add prefix and suffix default.deep_merge( name: name, configuration: { project_name: project_name }, ) else # Hash # With the hash, the user needs to set: name and configuration.project_name # Handy shorthands # The project name will allow this syntax # codebuild(name: "action-name", project_name: "codebuild-project-names") project_name = item.delete(:project_name) if project_name item[:configuration] = { project_name: project_name } end item.reverse_merge(default) end end action(*actions) end |
#codebuild_prefix(v) ⇒ Object
44 45 46 |
# File 'lib/codepipe/dsl/pipeline/codebuild.rb', line 44 def codebuild_prefix(v) @codebuild_prefix = v end |
#codebuild_suffix(v) ⇒ Object
48 49 50 |
# File 'lib/codepipe/dsl/pipeline/codebuild.rb', line 48 def codebuild_suffix(v) @codebuild_suffix = v end |