-
Notifications
You must be signed in to change notification settings - Fork 0
/
Deployment.py
24 lines (19 loc) · 951 Bytes
/
Deployment.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from sets import Set
release = getCurrentRelease()
deployPhase = phaseApi.newPhase("Deploy")
deployPhase = phaseApi.addPhase(release.id, deployPhase)
approveTask = taskApi.newTask('xlrelease.Task')
approveTask.title = 'Approve deployment'
taskApi.addTask(deployPhase.id, approveTask)
deployTask = taskApi.newTask('xlrelease.DeployitTask')
deployTask.title = 'Deploy to PROD'
deployTask.server = 'XL Deploy'
deployTask.deploymentPackage = '$' + '{Application}'
deployTask.environment = 'PROD'
taskApi.addTask(deployPhase.id, deployTask)
notificationTask = taskApi.newTask("xlrelease.NotificationTask")
notificationTask.addresses = Set(['[email protected]'])
notificationTask.title = "Send email of succesful deployment"
notificationTask.subject = '$' + '{Application} has been deployed to PROD'
notificationTask.body = '$' + '{Application} has been deployed to PROD by XL Release just now.'
taskApi.addTask(deployPhase.id, notificationTask)