Skip to content

Commit

Permalink
Merge pull request #24 from hopinc/deployment-type
Browse files Browse the repository at this point in the history
devex: active_build and active_rollout
  • Loading branch information
Looskie authored Oct 3, 2022
2 parents 623e788 + 8944800 commit b4966d1
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-crabs-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@onehop/js': patch
---

Added type `DeploymentRollout` and `DeploymentBuild` to types. Added `active_build` and `active_rollout` to deployment type
68 changes: 68 additions & 0 deletions src/rest/types/ignite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ export enum ContainerState {
EXITED = 'exited',
}

/**
* Rollout state for deployments
*/
export enum RolloutState {
PENDING = 'pending',
FINISHED = 'finished',
FAILED = 'FAILED',
}

/**
* Restart policy for deployments
*/
Expand Down Expand Up @@ -192,8 +201,67 @@ export interface Deployment {
* The config for this deployment
*/
config: Omit<DeploymentConfig, 'volume' | 'name'>;

/**
* Current active rollout for deployment
*/
active_rollout: DeploymentRollout | null;

/**
* Current active build for deployment
*/
active_build: DeploymentBuild | null;
}

export type DeploymentBuild = {
/**
* Deployment ID for build
*/
deployment_id: Id<'deployment'>;

/**
* Digest for image
*/
digest: string | null;

/**
* Timestamp of when the build has finished
*/
finished_at: Timestamp | null;

/**
* ID of the build
*/
id: Id<'build'>;
};

export type DeploymentRollout = {
/**
* How many containers are being recreated
*/
count: number;

/**
* When the rollout took place
*/
created_at: Timestamp;

/**
* The deployment ID for rollout
*/
deployment_id: Id<'deployment'>;

/**
* The rollout ID for rollout
*/
id: Id<'rollout'>;

/**
* The state of the rollout
*/
state: RolloutState;
};

// This is a type not an interface so we can make a union
// when future versions of deployment configs come out
export type DeploymentConfig = {
Expand Down

1 comment on commit b4966d1

@vercel
Copy link

@vercel vercel bot commented on b4966d1 Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hop-js – ./

js.hop.io
hop-js.vercel.app
hop-js-git-master-onehop.vercel.app
hop-js-onehop.vercel.app

Please sign in to comment.