We have a pipeline which trigger a workflow as a stage.After the workflow stage finished,we wanted to capture the pipeline name that it ran from and set it in the workflow email notifier. Could someone give some idea on how to implement it.
Answer by nitinp · Jul 05, 2017 at 10:57 PM
Please use
$[/myPipeline/pipelineName]
Here is a sample dsl, which creates a pipeline and workflow. Pipeline task invokes the workflow and workflow state has a notifier
project 'Default', { description = 'Default project created during installation.' procedure 'build', { jobNameTemplate = null step 'calc', { description = '' command = '''echo "hello" echo $[/myPipeline/pipelineName]''' condition = '' errorHandling = 'failProcedure' } } workflowDefinition 'wf', { description = '' workflowNameTemplate = '' stateDefinition 'st1', { description = '' startable = '1' subprocedure = 'build' subproject = '' emailNotifier 'notifier1', { description = '' configName = 'default' destinations = 'xyz@ec.com' eventType = 'onCompletion' formattingTemplate = '''Subject: Notification for $[/myPipeline/pipelineName] Message for $[/myPipeline/pipelineName]''' } } } pipeline 'demo_pipeline', { enabled = '1' stage 'qe', { pipelineName = 'demo_pipeline' task 'dev-t1', { enabled = '1' errorHandling = 'stopOnError' subproject = 'Default' subworkflowDefinition = 'wf' subworkflowStartingState = 'st1' taskType = 'WORKFLOW' } } } }
Electric Cloud powers Continuous Delivery, helping organizations developing deliver better software faster by automating and accelerating build, test, and deployment processes at scale. Industry leaders like Qualcomm, SpaceX, Cisco, GE, Gap, and E*TRADE use Electric Cloud solutions to boost DevOps productivity and Agile throughput.