@@ -28,6 +28,54 @@ def release_canary_publish_tags
2828 def release_canary_publish_release
2929 Pyxis ::Release ::Canary . new . publish_release ( options [ :coordinator_pipeline_id ] )
3030 end
31+
32+ desc 'release_notify_publish_pending' , ''
33+ method_option :coordinator_pipeline_id , required : true , type : :numeric
34+ def release_notify_publish_pending
35+ pipeline = GitlabClient . client . get_pipeline (
36+ Project ::Pyxis . api_gitlab_path ,
37+ options [ :coordinator_pipeline_id ]
38+ ) . body
39+ raise 'Pipeline not found' if pipeline . nil?
40+
41+ Pyxis ::DiscordClient . new . send_notification ( <<~DESC , :warn )
42+ Coordinator pipeline awaiting approval for release publishing
43+ #{ "> #{ pipeline . name } " if pipeline . name }
44+ #{ pipeline . web_url }
45+ DESC
46+ end
47+
48+ desc 'notify_new_coordinator' , ''
49+ method_option :coordinator_pipeline_id , required : true , type : :numeric
50+ def notify_new_coordinator
51+ pipeline = GitlabClient . client . get_pipeline (
52+ Project ::Pyxis . api_gitlab_path ,
53+ options [ :coordinator_pipeline_id ]
54+ ) . body
55+ raise 'Pipeline not found' if pipeline . nil?
56+
57+ Pyxis ::DiscordClient . new . send_notification ( <<~DESC )
58+ New coordinator pipeline started
59+ #{ "> #{ pipeline . name } " if pipeline . name }
60+ #{ pipeline . web_url }
61+ DESC
62+ end
63+
64+ desc 'notify_finish_coordinator' , ''
65+ method_option :coordinator_pipeline_id , required : true , type : :numeric
66+ def notify_finish_coordinator
67+ pipeline = GitlabClient . client . get_pipeline (
68+ Project ::Pyxis . api_gitlab_path ,
69+ options [ :coordinator_pipeline_id ]
70+ ) . body
71+ raise 'Pipeline not found' if pipeline . nil?
72+
73+ Pyxis ::DiscordClient . new . send_notification ( <<~DESC )
74+ Coordinator pipeline has finished
75+ #{ "> #{ pipeline . name } " if pipeline . name }
76+ #{ pipeline . web_url }
77+ DESC
78+ end
3179 end
3280 end
3381end
0 commit comments