Joe
Joe

Reputation: 4234

Change directory in pipe line bitbucket

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?

Upvotes: 15

Views: 22734

Answers (1)

Giovan Cruz
Giovan Cruz

Reputation: 721

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

Upvotes: 30

Related Questions