1

I have a project that uses gulp to build and I am setting up the GitLab Pipeline for Continuous Integration.

I committed some changes for the job to fail intentionally, the command failed but the job ended as "Succeeded".

This is the output:

sh: 1: gulp: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! Project@2.1.0 build-only: `gulp build-only`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the Project@2.1.0 build-only script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-10-28T21_44_15_322Z-debug.log
                        Successfully built project!!                        
----->======================================================================
Saving cache
Not uploading cache path/to/cache due to policy
Cleaning up file based variables
Job succeeded

The command returns 1, but the job still considers it as a success.

How do I set the job to fail in this case?

MSoutto
  • 68
  • 7

0 Answers0