Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ELI5 bitbucket pipelines. Error when running eslint on the project Edited

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  

 

1 answer

1 vote

Hi @DS ,

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

Hi @Theodora Boudale 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


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? 

Hi @DS ,

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

⚡️NEW Group for Confluence Cloud Admins

Calling all Confluence Cloud Admins!  We created a new Community Group to support your unique needs as Confluence admins. This is a group where you can ask questions, access resou...

106 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you