Skip to content

Commit 1979116

Browse files
committed
Add envs to liara.json.
1 parent 33998ef commit 1979116

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

src/commands/deploy.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,24 @@ export default class Deploy extends Command {
140140
}
141141
}
142142

143+
if (config.envs) {
144+
const MAX_SHOW_ENVS = 10;
145+
this.logKeyValue('Envs');
146+
Object.keys(config.envs)
147+
.slice(0, MAX_SHOW_ENVS)
148+
.forEach((key) => {
149+
console.log(` ${key} ${chalk.blue('=')} ${config.envs![key]}`);
150+
});
151+
152+
if (Object.keys(config.envs).length > MAX_SHOW_ENVS) {
153+
console.log(
154+
` ... and ${
155+
Object.keys(config.envs).length - MAX_SHOW_ENVS
156+
} more envs`,
157+
);
158+
}
159+
}
160+
143161
config.buildCache = !(config['no-cache'] || config.build?.cache === false);
144162

145163
this.debug(
@@ -201,6 +219,7 @@ export default class Deploy extends Command {
201219
this.logKeyValue('Path', config.path);
202220
this.logKeyValue('Platform', config.platform);
203221
this.logKeyValue('Port', String(config.port));
222+
204223
const response = await this.deploy(config);
205224

206225
if (flags.detach) {
@@ -394,6 +413,7 @@ Additionally, you can also retry the build with the debug flag:
394413
type: config.platform,
395414
message: config.message,
396415
disks: config.disks,
416+
envs: config.envs,
397417
};
398418

399419
if (config.image) {

src/types/liara-json.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default interface ILiaraJSON {
2525
build?: IBuildConfig;
2626
healthCheck?: IHealthConfig;
2727
'team-id'?: string;
28+
envs?: { [key: string]: string };
2829

2930
laravel?: ILaravelPlatformConfig;
3031
angular?: IAngularPlatformConfig;

0 commit comments

Comments
 (0)