Class: Deployme::Notifications::Jira
Class Method Summary
collapse
Instance Method Summary
collapse
all, defaults, #initialize
Class Method Details
.options(parser) ⇒ Object
6
7
8
9
10
11
|
# File 'lib/deployme/notifications/jira.rb', line 6
def self.options(parser)
parser.on('--jira-issues=TICKET,TICKET', Array, 'JIRA Tickets to Update') { |options, value| options.jira_issues = value }
parser.on('--jira-url=URL', String, 'JIRA Instance URL') { |options, value| options.jira_url = value }
parser.on('--jira-username=USERNAME', String, 'JIRA Instance Username') { |options, value| options.jira_username = value }
parser.on('--jira-token=PASSWORD', String, 'JIRA Instance Password') { |options, value| options.jira_token = value }
end
|
Instance Method Details
#notify_error(error = nil) ⇒ Object
16
|
# File 'lib/deployme/notifications/jira.rb', line 16
def notify_error(error = nil); end
|
#notify_finish ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/deployme/notifications/jira.rb', line 18
def notify_finish
return unless settings.issues
logger.info 'Adding Website link to JIRA'
settings.issues.each do |issue_key|
logger.info "Finding Issue: #{issue_key}"
next if options.dry_run
issue = client.Issue.find(issue_key)
next if issue.remotelink.all.any? { |link| link.attrs['object']['url'] == deployment.options.deploy_url }
logger.info "Adding link to #{deployment.options.deploy_url}"
link = issue.remotelink.build
link.save(
object: {
url: deployment.options.deploy_url,
title: deployment.options.deploy_url
}
)
end
end
|
#notify_start ⇒ Object
13
14
|
# File 'lib/deployme/notifications/jira.rb', line 13
def notify_start
end
|