Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbucket Pipeline - how to exclude files or folders?

How can I exclude folders or files from being uploaded to the server?

I would like to ignore the "src" folder and package.json.

# -----
image: node:10.15.3

pipelines:
  branches:
    develop:
    - step:
        caches:
        - node
        name: Deploy to develop (Nino) Continuous integration.
        script: # Modify the commands below to build your repository.
          - echo 'Deploying.. hold your horses!'
          - yarn install
          - yarn dev
          - pipe: atlassian/sftp-deploy:0.4.1
            variables:
                USER: $USER
                PASSWORD: $ROOT_PASSWORD
                SERVER: $SERVER
                REMOTE_PATH: /var/www/html/wordpress-starter/
                DEBUG: 'false'
like image 912
Galanthus Avatar asked Oct 19 '25 12:10

Galanthus


2 Answers

You could go the other way around and specify the folder(s) you want to include as trigger in each step:

- step:
          name: ...
          image: ...
          script:
              - ...
          condition:
              changesets:
                 includePaths:
                   - "folder1/*"
                   - "folder2/*"

In this example, the step will only run when folder1 or folder2 change. Found it here: https://dev.to/omar16100/trigger-bitbucket-pipeline-only-if-certain-files-are-changed-with-google-cloud-functions-1abc

like image 107
Pedro Magalhães Avatar answered Oct 22 '25 02:10

Pedro Magalhães


You can try this

EXTRA_ARGS: '--exclude=YOUR_DESIRE_FOLDER_PATH/*'

For more information please have a look at this.

like image 30
naib khan Avatar answered Oct 22 '25 03:10

naib khan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!