I am trying to configure a Node.js bitbucket pipeline to execute some commands in a package.json file that is in a different directory than the bitbucket-pipelines.yml in the root directory of the repo.
Currently, the pipelines are unable to locate the package.json to execute commands.
How can I set the path for the package.json where commands should be executed?
The script of your pipeline is executed line by line just as if it was in a shell. So first change directory to the one you need, then run commands you want to run in that directory:
- step:
script:
- cd relative/path/from/root
- npm ...
I hope this helps.
Cheers,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
These commands are running inside of the docker container running an image you specified in the Pipelines configuration file, so anything that works there will work as a pipeline step.
By the way, you can actually try to run the pipeline locally – might be useful for initial setup as well as for debugging.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.