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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* [PR-12](https://github.com/itk-devops/devops_itkdev-docker-server/pull/12)
Clean up Taskfile and dev tooling for `docker compose`.
* [PR-11](https://github.com/itk-devops/devops_itkdev-docker-server/pull/11)
Propagate command exit code instead of swallowing failed docker compose
commands.

## [0.0.14] - 2025-03-26

Expand Down
4 changes: 2 additions & 2 deletions src/commands/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ exports.handler = function (argv: { [x: string]: any; base: string; debug: any;

// Test env file exists.
if (!utils.isFile(argv.base + '/' + env)) {
console.error('The env file not found!');
return;
console.error(`The env (${env}) file not found!`);
process.exit(1);
}

// Hack to parse the commands that should be sendt to docker.
Expand Down
6 changes: 5 additions & 1 deletion src/modules/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ export default class Docker {
if (err instanceof Error) {
console.error(err.message);
}
return null;

// Propagate the failed command's exit code so callers (CI, Ansible)
// detect the failure instead of seeing a false success.
const status = (err as {status?: number | null}).status;
process.exit(typeof status === 'number' ? status : 1);
}
}
}
Expand Down
Loading