@contiamo/dev
Advanced tools
Comparing version 0.3.0 to 0.4.0-10-g004b42f
31
index.js
@@ -26,2 +26,5 @@ #!/usr/bin/env node | ||
const dockerCompose = YAML.parse(fs.readFileSync(dockerComposeFile, "utf-8")); | ||
const services = Object.keys(dockerCompose.services); | ||
// Program | ||
@@ -55,3 +58,3 @@ const { version } = fs.readFileSync( | ||
exec( | ||
`docker-compose -f ${dockerComposeFile} pull datastore ui auth pantheon profiler` | ||
`docker-compose -f ${dockerComposeFile} pull datastore ui auth pantheon profiler hub` | ||
); | ||
@@ -75,2 +78,26 @@ }); | ||
program | ||
.command("logs [SERVICE...]") | ||
.option( | ||
"--tail [n]", | ||
"Number of lines to show from the end of the logs for each container." | ||
) | ||
.option("-f, --follow", "Follow log output.") | ||
.description("Get logs of a service.") | ||
.action((_, { parent: { rawArgs }, tail, follow }) => { | ||
let args = []; | ||
if (typeof tail === "string") args.push(`--tail ${tail}`); | ||
if (follow) args.push(`-f`); | ||
args.push(...rawArgs.filter(i => services.includes(i))); | ||
exec(`docker-compose -f ${dockerComposeFile} logs ${args.join(" ")}`); | ||
}); | ||
program | ||
.command("restart [SERVICE...]") | ||
.description("Restart running containers.") | ||
.action((_, { parent: { rawArgs } }) => { | ||
let args = rawArgs.filter(i => services.includes(i)); | ||
exec(`docker-compose -f ${dockerComposeFile} restart ${args.join(" ")}`); | ||
}); | ||
program | ||
.command("stop") | ||
@@ -99,5 +126,5 @@ .description("Stop the running docker container") | ||
}; | ||
console.log(YAML.stringify(output)) | ||
console.log(YAML.stringify(output)); | ||
}); | ||
program.parse(process.argv); |
{ | ||
"name": "@contiamo/dev", | ||
"version": "0.3.0", | ||
"version": "0.4.0-10-g004b42f", | ||
"description": "Dev enviromnent for contiamo", | ||
@@ -5,0 +5,0 @@ "bin": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
51117
42
539
2