15

My folder structure:

-backend
-frontend

My reactapp is placed in frontend directory.

image: node:10.15.3

pipelines:
  default:
    - step:
        caches:
          - node
        script: # Modify the commands below to build your repository.
          - yarn install
          - yarn test
          - yarn build

This one fails. How do I go to the frontend-directory to run this?

Joe
  • 4,274
  • 32
  • 95
  • 175

1 Answers1

29

Bitbucket Pipeline run in one bitbucket cloud server.

So, similar as using a local command line interface, you can navigate using comands like cd, mkdir.

image: node:10.15.3

pipelines:
  default:
    - step:
        caches:
          - node
        script: # Modify the commands below to build your repository.
          - cd frontend
          - yarn install
          - yarn test
          - yarn build
          - cd ../ #if you need to go back
    #Then,probably you will need to deploy your app, so you can use:
          - apt-get update
          - apt-get -qq install git-ftp
          - git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD $FTP_HOST

If you need to test syntax of your yml file, try here

Giovan Cruz
  • 681
  • 9
  • 21
  • Do you have the github repo since I need the same pipelines setup for Wordpress? Thanks –  coinhndp Dec 02 '19 at 04:17
  • I have one private repo for my PHP website, for wordpress this code above work with some changes, you can try this. Let me know if you can't do, maybe i can help you. – Giovan Cruz Dec 05 '19 at 16:25