Bitbucket管道-如何排除文件或文件夹?

时间:2019-07-20 19:51:54

标签: git continuous-integration bitbucket bitbucket-pipelines

如何排除文件夹或文件无法上传到服务器?

我想忽略“ src”文件夹和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'

2 个答案:

答案 0 :(得分:1)

您可以尝试

EXTRA_ARGS: '--exclude=YOUR_DESIRE_FOLDER_PATH/*'

有关更多信息,请查看this

答案 1 :(得分:0)

如果您不想排除多个文件或目录,则应考虑使用rsync-deploy管道:

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'