ELI5 bitbucket pipelines. Error when running eslint on the project
Asked by DS:

Hi there, I'm trying to better understand how do pipelines actually work.

I'm guessing a docker image is created for each step on the pipeline, or is it just a single docker image?

I'm trying to hook a pipeline with an ubuntu server so it can deploy my react-app on every merge to \`master\`. The pipeline sort of works, but when there are some steps tha fail.

1. \`eslint\`

2. \`test\`

Here is my config:

![pipeline-bitbucket.png](https://community.atlassian.com/t5/image/serverpage/image-id/135622i4F2D36FC3DA89F42/image-size/large?v=v2&px=999 "pipeline-bitbucket.png")


Answers:
author: Theodora Boudale
body: Hi [@DS](/t5/user/viewprofilepage/user-id/4183757) ,

For each step of a pipeline, new Docker container starts, the repo is cloned in this container and then the commands of the script are executed.

If you define an image at the beginning of your bitbucket-pipelines.yml file, like in your screenshot, this image will be used for every step.

However, it is also possible to specify a different image for each step, an example from our docs for that is as follows:

```
pipelines:
  default:
    - step:
        name: Build and test
        image: node:10.15.0
        script:
          - npm install
          - npm test
          - npm run build
        artifacts:
          - dist/**
    - step:
        name: Deploy
        image: python:3.7.2
        trigger: manual
        script:
          - python deploy.py
```

It's a bit difficult to say why the errors occur without seeing any log info. Could you perhaps let us know:

1. Which steps are failing from your bitbucket-pipelines.yml file, and specifically which command fails for each step?
2. Could you share the output of these commands here, sanitizing any private/sensitive data in the output?

Kind regards,  
Theodora

comments: author: DS
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) I think the problem might be on how i'm structuring my repo ? I need to test this, but let me know what you think.  

Right now the command that fails is

```
 - step:
    name: Running the linter
    script:
     - yarn run lint  # [Error]: Unable to follow eslint
```

<br />

Right now my folder structure is

```
repo
  |
  website # where al the code for the app is found including package.json
  |
  bitbucket.pipeline.yml
```

I think I should tell the pipeline to first go to \`website\` and the run all the commands?


author: Theodora Boudale
body: Hi [@DS](/t5/user/viewprofilepage/user-id/4183757) ,

When you run a Pipelines build, a Docket container starts, then the branch is cloned in that Docker container (if it's a build running on a branch) and the commands of the script are executed in the directory of that clone.

If this command needs to run in the directory where you have your source, this might indeed be the culprit.

What you can do is add an extra command to switch to this directory first:

```
- step:
    name: Running the linter
    script:
      - cd website
      - yarn run lint
```

Could you give this a try and let me know how it goes?

Kind regards,  
Theodora


author: DS
body: [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) never managed to answer you, but everything running smoothly now. Thanks


author: Theodora Boudale
body: Hi [@DS](/t5/user/viewprofilepage/user-id/4183757),

Thank you for the update, that's good to hear and you are very welcome!

Please feel free to reach out if you ever need anything else.

Kind regards,  
Theodora


author: Simplatex
body: nvm. Fixed it.


Tags: bitbucket-pipelines

bitbucket-cloud

cloud

react.js