Bitbucket Pipeline - how to exclude files or folders?

天涯浪子 提交于 2019-12-02 04:46:11

问题


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'

回答1:


You can try this

EXTRA_ARGS: '--exclude=YOUR_DESIRE_FOLDER_PATH/*'

For more information please have a look at this.




回答2:


If you wan't to exclude multiple files or directories, you should consider using the rsync-deploy pipe:

script:
  - pipe: atlassian/rsync-deploy:0.3.2
    variables:
      USER: 'ec2-user'
      SERVER: '127.0.0.1'
      REMOTE_PATH: '/var/www/build/'
      LOCAL_PATH: 'build'
      DEBUG: 'true'
      EXTRA_ARGS: '--exclude=src/* --exclude=package.json'


来源:https://stackoverflow.com/questions/57128087/bitbucket-pipeline-how-to-exclude-files-or-folders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!