Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await Promise.map(services, async service => {
const { compose, dotenv, path } = service;
// compile the final docker-compose
finalDockerCompose = {
...finalDockerCompose,
...compose,
};
if (!dotenv) {
return;
}
const dotenvPath = filesystem.resolve(path, '.env');
let finalDotEnv = {};
const exists = await filesystem.exists(dotenvPath);
if (exists) {
const raw = await filesystem.read(dotenvPath);
finalDotEnv = parseEnv(raw);
}
finalDotEnv = {
...finalDotEnv,
...dotenv,
};
await filesystem.write(dotenvPath, stringifyToEnv(finalDotEnv));
.filter(i => !!i)
.forEach(proxies => {
proxies.forEach(proxy => {
const { port, protocol = 'http', paths } = proxy;
paths.forEach(path => {
routes[path] = `${protocol}://${dockerhost}:${port}`;
});
});
});
const proxy = get('proxy');
if (get('proxy.ssl.key')) {
proxy.ssl.key = await filesystem.read(
filesystem.resolve(get('cwd'), get('proxy.ssl.key'))
);
}
if (get('proxy.ssl.cert')) {
proxy.ssl.cert = await filesystem.read(
filesystem.resolve(get('cwd'), get('proxy.ssl.cert'))
);
}
const httpPort = get('proxy.httpPort', 80);
const environment = {
DEVCTL_PROXY: JSON.stringify(
{
routes,
proxy,
const { filesystem, system, print } = require('gluegun');
const homedir = require('os').homedir();
const { execSync } = require('child_process');
const lastDCPath = filesystem.resolve(homedir, '.devctl-current');
async function getLastComposeFile() {
const exists = await filesystem.exists(lastDCPath);
if (!exists) {
return null;
}
return filesystem.read(lastDCPath);
}
async function writeComposeFileToHomeDir(compose) {
return filesystem.write(lastDCPath, compose);
}
function createDockerComposeCommand(compose, async = true) {