Skip to content

Commit

Permalink
Merge pull request #22 from hopinc/feat/deployment-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
alii authored Sep 25, 2022
2 parents 49189db + 38f7c55 commit 611acbd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": true,
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
Expand Down
5 changes: 5 additions & 0 deletions .changeset/pretty-bees-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@onehop/js': patch
---

add patching deployments
6 changes: 6 additions & 0 deletions src/rest/types/ignite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,4 +535,10 @@ export type IgniteEndpoints =
'/v1/ignite/deployments/:deployment_id/gateways',
{gateway: Gateway},
{type: GatewayType; target_port: number; protocol: Gateway['protocol']}
>
| Endpoint<
'PATCH',
'/v1/ignite/deployments/:deployment_id',
{deployment: Deployment},
DeploymentConfig
>;
13 changes: 13 additions & 0 deletions src/sdks/ignite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {create, Infer} from '@onehop/json-methods';
import {API, assertId, Id} from '../rest/index.js';
import {
Deployment,
DeploymentConfig,
Gateway,
GatewayType,
RuntimeType,
Expand Down Expand Up @@ -218,6 +219,18 @@ export const ignite = sdk(client => {
create: createDeployment,
get: getDeployment,

async update(deploymentId: Id<'deployment'>, config: DeploymentConfig) {
const {deployment} = await client.patch(
'/v1/ignite/deployments/:deployment_id',
config,
{
deployment_id: deploymentId,
},
);

return deployment;
},

/**
* Get all containers for a deployment
*
Expand Down

1 comment on commit 611acbd

@vercel
Copy link

@vercel vercel bot commented on 611acbd Sep 25, 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 – ./

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

Please sign in to comment.