forked from electric-cloud-community/DSL-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimplePipeLine.groovy
executable file
·51 lines (41 loc) · 1.68 KB
/
simplePipeLine.groovy
1
2
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
43
44
45
46
47
48
49
50
51
/*
Format: Electric Flow DSL
File: simplePipeLine.groovy
Description: Simple Development Pipeline model
Features
--------
Command-line run instructions
-----------------------------
ectool deleteProject 'Simple Pipeline'
ectool evalDsl --dslFile simplePipeLine.groovy
See workflow at:
Simple Pipeline::Release Pipeline
With https://github.com/electriccommunity/ec-pipeline-activity, view the Pipeline:
https://flow/commander/pages/PipelineActivity/activity?projectName=Simple%20Pipeline&workflowDefinitionName=Release%20Pipeline
*/
def projName = 'Simple Pipeline'
def workflow = 'Release Pipeline'
def states = ['Artifacts Ready','Test','UAT','Production']
// Create new
project projName, {
workflowDefinition workflowDefinitionName: workflow,
workflowNameTemplate: workflow + '_' + '$' + "[/increment /server/ec_counters/workflowCounter]", {
states.each { stateName ->
procedure "${stateName}_proc",
jobNameTemplate: stateName + '_' + '$' + "[/increment /server/ec_counters/jobCounter]", {
step stepName: 'DEMO: NOP',
command: ""
}
stateDefinition stateDefinitionName: stateName,
subprocedure: "${stateName}_proc"
}
transitionDefinition stateDefinitionName: 'Artifacts Ready',
transitionDefinitionName: "Promote to Test", targetState: 'Test'
transitionDefinition stateDefinitionName: 'Test',
transitionDefinitionName: "Promote to UAT", targetState: 'UAT'
transitionDefinition stateDefinitionName: 'UAT',
transitionDefinitionName: "Promote to Prod", targetState: 'Production'
transitionDefinition stateDefinitionName: 'Artifacts Ready',
transitionDefinitionName: "Hotpatch", targetState: 'Production'
}
}