Class: LabClient::Generator::PipelineTrigger
- Inherits:
-
GroupTemplateHelper
- Object
- TemplateHelper
- GroupTemplateHelper
- LabClient::Generator::PipelineTrigger
- Defined in:
- lib/labclient/generator/templates/pipeline_trigger.rb
Overview
Child and other Trigger Examples docs.gitlab.com/ee/ci/yaml/#trigger
Instance Attribute Summary
Attributes inherited from GroupTemplateHelper
#group_name, #group_path, #group_suffix, #project_name
Attributes inherited from TemplateHelper
Instance Method Summary collapse
- #child_pipeline_yaml ⇒ Object
- #create_child_pipeline ⇒ Object
- #setup_projects ⇒ Object
- #trigger_child_pipeline_yaml ⇒ Object
Methods inherited from GroupTemplateHelper
#generate_group, #run!, #setup
Methods included from Names
#create_file, #gen_description, #gen_groups, #gen_people, #gen_projects, #generate_names
Methods inherited from TemplateHelper
Constructor Details
This class inherits a constructor from LabClient::Generator::TemplateHelper
Instance Method Details
#child_pipeline_yaml ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/labclient/generator/templates/pipeline_trigger.rb', line 49 def child_pipeline_yaml <<~YAML image: busybox:latest child: script: - echo "Do your build here" YAML end |
#create_child_pipeline ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/labclient/generator/templates/pipeline_trigger.rb', line 59 def create_child_pipeline project = @group.project_create( name: 'Child Pipeline', description: 'Child Pipeline', auto_devops_enabled: false ) # Create Child project.file_create( 'child_pipeline.yml', create_file(child_pipeline_yaml) ) # Create Parent project.file_create( '.gitlab-ci.yml', create_file(trigger_child_pipeline_yaml) ) @projects.push project end |
#setup_projects ⇒ Object
23 24 25 |
# File 'lib/labclient/generator/templates/pipeline_trigger.rb', line 23 def setup_projects create_child_pipeline end |
#trigger_child_pipeline_yaml ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/labclient/generator/templates/pipeline_trigger.rb', line 27 def trigger_child_pipeline_yaml <<~YAML image: busybox:latest build_child: stage: build script: - cp child_pipeline.yml artifact.yml artifacts: paths: - artifact.yml trigger_child: stage: deploy trigger: include: - artifact: artifact.yml job: build_child YAML end |