cli icon indicating copy to clipboard operation
cli copied to clipboard

Report a non-zero exit code if build fails

Open tzmanics opened this issue 10 years ago • 4 comments

If any part of a build fails, the CLI should exit with a non-zero code.

tzmanics avatar Jan 25 '16 13:01 tzmanics

So much in favor of this. I'm working for a CI company and just looked at the build of one of our users, which is all green even though all steps involving the Modulus CLI actually failed :(

Is there a way we could work around this at the moment?

mlocher avatar Mar 21 '16 18:03 mlocher

@tzmanics We actually have error handling in place in the CLI that will return a nonzero exit code on process error. Is this an issue of an error not being thrown during a specific use case?

musgravejw avatar Mar 31 '16 17:03 musgravejw

@musgravejw This is not a local process error, but an error in a remote process. The CLI at this point in the deploy is a dumb pipe for the log, so we will probably need to add some string parsing. Maybe looking for something like npm does:

it worked if it ends with ok

jackboberg avatar Mar 31 '16 18:03 jackboberg

I saw an example that looks like this issue today:

31.3 MB written
Uploading project...

Deploying project into Node.js runtime...
Starting build.
Creating directories for build environment.
Build attempt failed, attempting again.
Starting build.
Creating directories for build environment.
Build attempt failed, attempting again.
Starting build.
Creating directories for build environment.
Build failed, reverting project.
 
[✓] ${projectName} running at ${domain}.onmodulus.net

at which point the deploy command ended with a zero exit code. Since the deploy actually failed ("Build failed") I would have expected a non-zero exit code in this case.

larsthorup avatar Dec 28 '16 14:12 larsthorup