-
Notifications
You must be signed in to change notification settings - Fork 10
(BOLT-372) Add plan commands #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,18 +4,33 @@ def initialize(https) | |
| @https = https | ||
| end | ||
|
|
||
| def task(options = {}) | ||
| def deploy(options = {}) | ||
| raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash | ||
| @https.post("command/task", options) | ||
| @https.post("command/deploy", options) | ||
| end | ||
|
|
||
| def deploy(options = {}) | ||
| def plan_start(options = {}) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When will plan_start/plan_finish be used? Or how are they exposed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤷♂️
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bolt will call it directly in other words. The orchestrator transport is informed that a plan is running before the plan starts. It then calls start plan on the client before running any tasks. |
||
| raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash | ||
| @https.post("command/deploy", options) | ||
| @https.post("command/plan_start", options) | ||
| end | ||
|
|
||
| def plan_finish(options = {}) | ||
| raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash | ||
| @https.post("command/plan_finish", options) | ||
| end | ||
|
|
||
| def plan_task(options = {}) | ||
| raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash | ||
| @https.post("command/plan_task", options) | ||
| end | ||
|
|
||
| def stop(job_number) | ||
| data = {"job" => "#{job_number}"} | ||
| @https.post("command/stop",data) | ||
| end | ||
|
|
||
| def task(options = {}) | ||
| raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash | ||
| @https.post("command/task", options) | ||
| end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a one-time set here brings no actual benefit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the other ruby way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh for some reason I thought arrays responded to include based on their indexes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://ruby-doc.org/core-2.2.0/Array.html#method-i-include-3F