Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ async function addComponent(req) {

log.trace(`adding component`);
const cfDir = configUtils.getConfigPath(hdbTerms.CONFIG_PARAMS.COMPONENTSROOT);
const { project, install_command, install_timeout } = req;
const { project, install_command, install_timeout, install_allow_scripts } = req;

const template = req.template || 'https://github.com/harperdb/application-template';

Expand All @@ -230,6 +230,7 @@ async function addComponent(req) {
install: {
command: install_command,
timeout: install_timeout,
allowInstallScripts: install_allow_scripts,
},
});
await prepareApplication(application);
Expand Down Expand Up @@ -375,10 +376,11 @@ async function deployComponent(req) {

const applicationConfig = { package: req.package };
// Avoid writing an empty `install:` block
if (req.install_command || req.install_timeout) {
if (req.install_command || req.install_timeout || req.install_allow_scripts !== undefined) {
applicationConfig.install = {
command: req.install_command,
timeout: req.install_timeout,
allowInstallScripts: req.install_allow_scripts,
};
}
await configUtils.addConfig(req.project, applicationConfig);
Expand All @@ -391,6 +393,7 @@ async function deployComponent(req) {
install: {
command: req.install_command,
timeout: req.install_timeout,
allowInstallScripts: req.install_allow_scripts,
},
});

Expand Down
2 changes: 2 additions & 0 deletions components/operationsValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ function addComponentValidator(req) {
template: Joi.string().optional(),
install_command: Joi.string().optional(),
install_timeout: Joi.number().optional(),
install_allow_scripts: Joi.boolean().optional(),
});

return validator.validateBySchema(req, addFuncSchema);
Expand Down Expand Up @@ -239,6 +240,7 @@ function deployComponentValidator(req) {
restart: Joi.alternatives().try(Joi.boolean(), Joi.string().valid('rolling')).optional(),
install_command: Joi.string().optional(),
install_timeout: Joi.number().optional(),
install_allow_scripts: Joi.boolean().optional(),
force: Joi.boolean().optional(),
});

Expand Down
Loading