Skip to content

Commit

Permalink
add more js things
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmJSD committed Feb 10, 2023
1 parent 1c18eec commit 50068c2
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 50 deletions.
42 changes: 42 additions & 0 deletions types/ignite.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,9 @@ type BuildMetadata struct {
type BuildState string

const (
// BuildStateValidating is used to define a build that is validating.
BuildStateValidating BuildState = "validating"

// BuildStatePending is used to define a build that is pending.
BuildStatePending BuildState = "pending"

Expand All @@ -663,8 +666,41 @@ const (

// BuildStateCancelled is used to define a build that has been canceled.
BuildStateCancelled BuildState = "cancelled"

// BuildStateValidationFailed is used to define a build where the validation failed.
BuildStateValidationFailed BuildState = "validation_failed"
)

// BuildCmds is used to define the commands for the build.
type BuildCmds struct {
// Build is the command used for builds. Can be nil.
Build *string `json:"build"`

// Start is the command used for starting the container. Can be nil.
Start *string `json:"start"`

// Install is the command used for installing the container. Can be nil.
Install *string `json:"install"`
}

// BuildEnvironment contains information about the build environment.
type BuildEnvironment struct {
// Language is the language this was built with. Can be nil.
Language *string `json:"language"`

// Cmds are the commands that were invoked during the build.
Cmds BuildCmds `json:"cmds"`
}

// BuildValidationFailure is used to define a build validation failure.
type BuildValidationFailure struct {
// Reason is the reason that the validation failed.
Reason string `json:"reason"`

// HelpLink is used to define a help link if present. Can be nil.
HelpLink *string `json:"help_link"`
}

// Build is used to define the active build of a deployment.
type Build struct {
// ID is the ID of the build.
Expand All @@ -690,6 +726,12 @@ type Build struct {

// Digest is the digest for the image. Can be blank for no value.
Digest string `json:"digest"`

// Environment is information about the build environment.
Environment BuildEnvironment `json:"environment"`

// ValidationFailure is set when the build state is failed.
ValidationFailure *BuildValidationFailure `json:"validation_failure"`
}

// DeploymentMetadata is the deployments metadata.
Expand Down
14 changes: 13 additions & 1 deletion types/testdata/types.Build.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,17 @@
"started_at": "jkl",
"finished_at": "mno",
"state": "pqr",
"digest": "stu"
"digest": "stu",
"environment": {
"language": "vwx",
"cmds": {
"build": "abc",
"start": "def",
"install": "ghi"
}
},
"validation_failure": {
"reason": "jkl",
"help_link": "mno"
}
}
128 changes: 82 additions & 46 deletions types/testdata/types.Deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,78 +67,114 @@
"started_at": "def",
"finished_at": "ghi",
"state": "jkl",
"digest": "mno"
"digest": "mno",
"environment": {
"language": "pqr",
"cmds": {
"build": "stu",
"start": "vwx",
"install": "abc"
}
},
"validation_failure": {
"reason": "def",
"help_link": "ghi"
}
},
"acknowledged": true,
"init_container_id": "pqr",
"init_container_id": "jkl",
"health_check_failed": true,
"last_updated_at": "stu"
"last_updated_at": "mno"
},
"latest_rollout": {
"count": 46,
"created_at": "vwx",
"deployment_id": "abc",
"id": "def",
"status": "ghi",
"count": 52,
"created_at": "pqr",
"deployment_id": "stu",
"id": "vwx",
"status": "abc",
"build": {
"id": "jkl",
"deployment_id": "mno",
"id": "def",
"deployment_id": "ghi",
"metadata": {
"account_type": "pqr",
"account_type": "jkl",
"author": {
"avatar_url": "stu",
"username": "vwx"
"avatar_url": "mno",
"username": "pqr"
},
"repo_id": 56,
"repo_name": "abc",
"branch": "def",
"commit_sha": "ghi",
"commit_msg": "jkl",
"commit_url": "mno"
"repo_id": 62,
"repo_name": "stu",
"branch": "vwx",
"commit_sha": "abc",
"commit_msg": "def",
"commit_url": "ghi"
},
"method": "jkl",
"started_at": "mno",
"finished_at": "pqr",
"state": "stu",
"digest": "vwx",
"environment": {
"language": "abc",
"cmds": {
"build": "def",
"start": "ghi",
"install": "jkl"
}
},
"method": "pqr",
"started_at": "stu",
"finished_at": "vwx",
"state": "abc",
"digest": "def"
"validation_failure": {
"reason": "mno",
"help_link": "pqr"
}
},
"acknowledged": true,
"init_container_id": "ghi",
"init_container_id": "stu",
"health_check_failed": true,
"last_updated_at": "jkl"
"last_updated_at": "vwx"
},
"active_build": {
"id": "mno",
"deployment_id": "pqr",
"id": "abc",
"deployment_id": "def",
"metadata": {
"account_type": "stu",
"account_type": "ghi",
"author": {
"avatar_url": "vwx",
"username": "abc"
"avatar_url": "jkl",
"username": "mno"
},
"repo_id": 74,
"repo_name": "def",
"branch": "ghi",
"commit_sha": "jkl",
"commit_msg": "mno",
"commit_url": "pqr"
"repo_id": 86,
"repo_name": "pqr",
"branch": "stu",
"commit_sha": "vwx",
"commit_msg": "abc",
"commit_url": "def"
},
"method": "stu",
"started_at": "vwx",
"finished_at": "abc",
"state": "def",
"digest": "ghi"
"method": "ghi",
"started_at": "jkl",
"finished_at": "mno",
"state": "pqr",
"digest": "stu",
"environment": {
"language": "vwx",
"cmds": {
"build": "abc",
"start": "def",
"install": "ghi"
}
},
"validation_failure": {
"reason": "jkl",
"help_link": "mno"
}
},
"metadata": {
"container_port_mappings": {
"jkl": [
"mno"
"pqr": [
"stu"
]
}
},
"running_container_count": 87,
"running_container_count": 105,
"build_cache_enabled": true,
"build_settings": {
"root_directory": "pqr"
"root_directory": "vwx"
}
}
18 changes: 15 additions & 3 deletions types/testdata/types.DeploymentRollout.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,22 @@
"started_at": "vwx",
"finished_at": "abc",
"state": "def",
"digest": "ghi"
"digest": "ghi",
"environment": {
"language": "jkl",
"cmds": {
"build": "mno",
"start": "pqr",
"install": "stu"
}
},
"validation_failure": {
"reason": "vwx",
"help_link": "abc"
}
},
"acknowledged": true,
"init_container_id": "jkl",
"init_container_id": "def",
"health_check_failed": true,
"last_updated_at": "mno"
"last_updated_at": "ghi"
}

0 comments on commit 50068c2

Please sign in to comment.