class Payload

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.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


[View source]

Instance Method Detail

def created_at : String | Nil #

[View source]
def created_at=(created_at : String | Nil) #

[View source]
def description : String | Nil #

[View source]
def description=(description : String | Nil) #

[View source]
def environment : String | Nil #

[View source]
def environment=(environment : String | Nil) #

[View source]
def id : String | Nil #

[View source]
def id=(id : String | Nil) #

[View source]
def locked : Bool | Nil #

[View source]
def locked=(locked : Bool | Nil) #

[View source]
def path : String | Nil #

[View source]
def path=(path : String | Nil) #

[View source]
def production : Bool | Nil #

[View source]
def production=(production : Bool | Nil) #

[View source]
def ref : String | Nil #

[View source]
def ref=(ref : String | Nil) #

[View source]
def repo : String | Nil #

[View source]
def repo=(repo : String | Nil) #

[View source]
def 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


[View source]
def run_post_deploy? : Bool #

[View source]
def sha : String | Nil #

[View source]
def sha=(sha : String | Nil) #

[View source]
def 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


[View source]
def ship_it? : Bool #

[View source]
def state : String | Nil #

[View source]
def state=(state : String | Nil) #

[View source]
def status : String | Nil #

[View source]
def status=(status : String | Nil) #

[View source]
def 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


[View source]
def success? : Bool | Nil #

[View source]
def tag : String | Nil #

[View source]
def tag=(tag : String | Nil) #

[View source]
def timezone : String | Nil #

[View source]
def timezone=(timezone : String | Nil) #

[View source]
def 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


[View source]
def type : String | Nil #

[View source]
def type=(type : String | Nil) #

[View source]
def updated_at : String | Nil #

[View source]
def updated_at=(updated_at : String | Nil) #

[View source]
def url : String | Nil #

[View source]
def url=(url : String | Nil) #

[View source]
def user : String | Nil #

[View source]
def user=(user : String | Nil) #

[View source]