| Server IP : 34.87.99.72 / Your IP : 216.73.217.31 Web Server : Apache/2.4.46 (Unix) OpenSSL/1.1.1n System : Linux zlock-bitnami-lamp-prod-v2-vm 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 User : bitnami ( 1000) PHP Version : 7.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /opt/bitnami/nami/node_modules/provisioner/lib/recipes/ |
Upload File : |
/// <reference path="../../typings-recipe.d.ts" />
/*
* Run initialization scripts specified in the setupScripts object of a definition
*/
"use strict";
recipes.register({
id: "setup-scripts",
// Provisioning is performed in multi-tier images during build (boot for image-less platforms)
// It is not executed for single VMs meaning this recipe needs to be called externally during build time
on: { provisionMachine: { depends: ["system-packages"] } },
conditions: {
shouldInvoke: function hasBashModules() {
return provisioner.tierDefinition.filterModulesByAssetType("bash").length > 0;
},
},
recipeHandler: function (input) {
// We execute postunpack logic during provisioning, which happens within during the construction of the final image
for (const m of provisioner.tierDefinition.filterModulesByAssetType("bash")) {
m.runExport("postunpack");
}
// Execute setup scripts after postunpack scripts, which are image-specific scripts not tied to a specific component
const env = { PATH: `${provisioner.platform.getAdditionalSystemPaths().join(":")}:${process.env.PATH}` };
provisioner.tierDefinition.setupScripts.forEach(setupScript => {
logger.info(`Running setup script ${setupScript}`);
$os.runProgram("bash", ["-c", setupScript], { env });
});
}
});