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:
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:
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @DS,
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
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.