bitbucketbitbucket-pipelinesbitbucket-aws-code-deploy

How to exclude Multiple folders with the EXTRA_ARGS variable?


With the current syntax of bitbucket's EXTRA_ARGS variable one directory is excluded from deployment like this:

EXTRA_ARGS: '--exclude=YOUR_DESIRE_FOLDER_PATH/*'

(Bitbucket Pipeline - how to exclude files or folders?)

But how to exclude multiple directories?


Solution

  • First, note that not every pipe has a support for --exclude option, as some pipes are just wrappers around the cli tools, like rsync or sftp. However, if you use the rsync-deploy pipe, you should be able to use multiple --exclude options:

    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=*.txt --exclude=src/*'