class Payload
- Payload
- Reference
- Object
Overview
The payload class is used as a data structure to hold the data that is passed from event triggers to deployment handlers This class is highly flexible and can be used to pass all sorts of data between the two components The class is designed to be used as a data structure and should not contain any logic Feel free to open a PR and add more fields to this class if you need
Defined in:
runway/models/deployment_payload.crConstructors
-
.new(ship_it : Bool = false, run_post_deploy : Bool = false, success : Bool | Nil = nil, sha : String | Nil = nil, ref : String | Nil = nil, tag : String | Nil = nil, environment : String | Nil = nil, repo : String | Nil = nil, production : Bool | Nil = nil, id : String | Nil = nil, status : String | Nil = nil, state : String | Nil = nil, created_at : String | Nil = nil, updated_at : String | Nil = nil, locked : Bool | Nil = nil, timezone : String | Nil = nil, type : String | Nil = nil, url : String | Nil = nil, description : String | Nil = nil, user : String | Nil = nil, path : String | Nil = nil)
Here is a rough description of what each field could be used for All of these fields are optional and can be used as needed - they default to nil @param ship_it [Bool] - A flag to indicate if the deployment was triggered or not - most important field as its used everywhere @param run_post_deploy [Bool] - A flag to indicate if the post_deploy hook should be run or not - this field is also important as it tells the event class that triggered the deployment to run the post_deploy hook or not @param success [Bool or nil] - A flag to indicate if the deployment was successful or not - useful and used frequently in post_deploy hooks @param sha [String or nil] - The commit sha that triggered the deployment or the sha to actually deploy @param ref [String or nil] - The branch or tag that triggered the deployment or the ref to actually deploy @param tag [String or nil] - The tag that triggered the deployment or the tag to actually deploy/use @param environment [String or nil] - The environment that the deployment is targeting or should be deployed to @param repo [String or nil] - The repository that the deployment is targeting or related to @param production [Bool or nil] - A flag to indicate if the deployment is targeting a production environment @param id [String or nil] - The unique identifier for the deployment, probably something like "123abc123" - its a string just in case @param status [String or nil] - The status of the deployment, probably something like "pending" or "success" or "in_progress" @param state [String or nil] - The state of the deployment, probably something like "success" or "failure" or "paused" @param created_at [String or nil] - The timestamp when the deployment was created - hopefully in a format that can be parsed by Time @param updated_at [String or nil] - The timestamp when the deployment was last updated - hopefully in a format that can be parsed by Time @param locked [Bool or nil] - A flag to indicate if the deployment environment is locked or not @param timezone [String or nil] - The timezone that the timestamps (or deployments) are in, probably something like "UTC" or "America/New_York" @param type [String or nil] - The type of deployment, probably something like "deploy" or "rollback" or "promote" @param url [String or nil] - The URL to the deployment or the deployment status page @param description [String or nil] - A description of the deployment or the reason for the deployment @param user [String or nil] - The user that triggered the deployment or the user that is responsible for the deployment @param path [String or nil] - The path to a file that is related to the deployment or the deployment itself
Instance Method Summary
- #created_at : String | Nil
- #created_at=(created_at : String | Nil)
- #description : String | Nil
- #description=(description : String | Nil)
- #environment : String | Nil
- #environment=(environment : String | Nil)
- #id : String | Nil
- #id=(id : String | Nil)
- #locked : Bool | Nil
- #locked=(locked : Bool | Nil)
- #path : String | Nil
- #path=(path : String | Nil)
- #production : Bool | Nil
- #production=(production : Bool | Nil)
- #ref : String | Nil
- #ref=(ref : String | Nil)
- #repo : String | Nil
- #repo=(repo : String | Nil)
-
#run_post_deploy=(run_post_deploy : Bool)
This is a helper method to set the run_post_deploy flag to true (or even false) after the Payload object has been created
- #run_post_deploy? : Bool
- #sha : String | Nil
- #sha=(sha : String | Nil)
-
#ship_it=(ship_it : Bool)
This is a helper method to set the ship_it flag to true (or even false) after the Payload object has been created
- #ship_it? : Bool
- #state : String | Nil
- #state=(state : String | Nil)
- #status : String | Nil
- #status=(status : String | Nil)
-
#success=(success : Bool | Nil)
These are helper methods to set the success flag to true (or even false) after the Payload object has been created
- #success? : Bool | Nil
- #tag : String | Nil
- #tag=(tag : String | Nil)
- #timezone : String | Nil
- #timezone=(timezone : String | Nil)
-
#to_h
This method is used to convert the Payload object to a Hash object It preserves the type of the instance variables as well
- #type : String | Nil
- #type=(type : String | Nil)
- #updated_at : String | Nil
- #updated_at=(updated_at : String | Nil)
- #url : String | Nil
- #url=(url : String | Nil)
- #user : String | Nil
- #user=(user : String | Nil)
Constructor Detail
Here is a rough description of what each field could be used for All of these fields are optional and can be used as needed - they default to nil @param ship_it [Bool] - A flag to indicate if the deployment was triggered or not - most important field as its used everywhere @param run_post_deploy [Bool] - A flag to indicate if the post_deploy hook should be run or not - this field is also important as it tells the event class that triggered the deployment to run the post_deploy hook or not @param success [Bool or nil] - A flag to indicate if the deployment was successful or not - useful and used frequently in post_deploy hooks @param sha [String or nil] - The commit sha that triggered the deployment or the sha to actually deploy @param ref [String or nil] - The branch or tag that triggered the deployment or the ref to actually deploy @param tag [String or nil] - The tag that triggered the deployment or the tag to actually deploy/use @param environment [String or nil] - The environment that the deployment is targeting or should be deployed to @param repo [String or nil] - The repository that the deployment is targeting or related to @param production [Bool or nil] - A flag to indicate if the deployment is targeting a production environment @param id [String or nil] - The unique identifier for the deployment, probably something like "123abc123" - its a string just in case @param status [String or nil] - The status of the deployment, probably something like "pending" or "success" or "in_progress" @param state [String or nil] - The state of the deployment, probably something like "success" or "failure" or "paused" @param created_at [String or nil] - The timestamp when the deployment was created - hopefully in a format that can be parsed by Time @param updated_at [String or nil] - The timestamp when the deployment was last updated - hopefully in a format that can be parsed by Time @param locked [Bool or nil] - A flag to indicate if the deployment environment is locked or not @param timezone [String or nil] - The timezone that the timestamps (or deployments) are in, probably something like "UTC" or "America/New_York" @param type [String or nil] - The type of deployment, probably something like "deploy" or "rollback" or "promote" @param url [String or nil] - The URL to the deployment or the deployment status page @param description [String or nil] - A description of the deployment or the reason for the deployment @param user [String or nil] - The user that triggered the deployment or the user that is responsible for the deployment @param path [String or nil] - The path to a file that is related to the deployment or the deployment itself
Instance Method Detail
This is a helper method to set the run_post_deploy flag to true (or even false) after the Payload object has been created
This is a helper method to set the ship_it flag to true (or even false) after the Payload object has been created
These are helper methods to set the success flag to true (or even false) after the Payload object has been created
This method is used to convert the Payload object to a Hash object It preserves the type of the instance variables as well