Skip to content

Commit 68af1f1

Browse files
committed
Support for deployment name on deploy-website
1 parent 272620c commit 68af1f1

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

packages/cli/src/modules/hosting/hosting.commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function createHostingCommands(cli: Command) {
2525
.argument('<path>', 'path to folder with website files')
2626
.requiredOption('--uuid <website uuid>', 'UUID of website to deploy')
2727
.option('-p, --preview', 'deploys to staging environment')
28+
.option('--name <deployment name>', 'Name of the deployment')
2829
.action(async function (path) {
2930
await deployWebsite(path, this.optsWithGlobals());
3031
});

packages/sdk/src/modules/hosting/hosting-website.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ApillonApi } from '../../lib/apillon-api';
1010
import { ApillonLogger } from '../../lib/apillon-logger';
1111
import { uploadFiles } from '../../util/file-utils';
1212
import { ApillonModel } from '../../lib/apillon';
13-
import { FileMetadata, IFileUploadRequest } from '../../types/storage';
13+
import { FileMetadata, IDeployRequest, IFileUploadRequest } from '../../types/storage';
1414

1515
export class HostingWebsite extends ApillonModel {
1616
/**
@@ -114,7 +114,7 @@ export class HostingWebsite extends ApillonModel {
114114
* @param {DeployToEnvironment} toEnvironment The environment to deploy to
115115
* @returns Newly created deployment
116116
*/
117-
public async deploy(toEnvironment: DeployToEnvironment) {
117+
public async deploy(toEnvironment: DeployToEnvironment, params?: IDeployRequest) {
118118
ApillonLogger.log(
119119
`Deploying website ${this.uuid} to IPFS (${
120120
toEnvironment === DeployToEnvironment.TO_STAGING
@@ -126,7 +126,7 @@ export class HostingWebsite extends ApillonModel {
126126
ApillonLogger.logWithTime('Initiating deployment');
127127
const data = await ApillonApi.post<Deployment & { deploymentUuid: string }>(
128128
`${this.API_PREFIX}/deploy`,
129-
{ environment: toEnvironment },
129+
{ environment: toEnvironment, ...params },
130130
);
131131

132132
ApillonLogger.logWithTime('Deployment in progress');

packages/sdk/src/types/storage.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ export interface IFileUploadRequest {
9797
ignoreFiles?: boolean;
9898
}
9999

100+
export interface IDeployRequest {
101+
/**
102+
* Name of the deployment.
103+
*/
104+
name?: string;
105+
}
106+
100107
export interface IFileUploadResponse {
101108
files: FileMetadata[];
102109
sessionUuid: string;

0 commit comments

Comments
 (0)