andres-montanez / Magallanes

The PHP Deployment Tool
https://magephp.com
MIT License
691 stars 169 forks source link

Excludes are not excluded :( #398

Closed robertosanval closed 7 years ago

robertosanval commented 7 years ago

Hello,

I'm having problems with the excludes sections, it seem to be OK and the rsync command is generated well without errors but excludes section is ignored and rsync command uploads all the files even the supossed to be excluded.

This is my .mage.yml

magephp:
    log_dir: ./var/logs/mage
    exclude:
        - ./var/cache/dev/*
        - ./var/cache/prod/*
        - ./var/log/*
        - ./web/app_dev.php
        - ./*.skipper
        - ./web/media/cache/*
        - ./web/assets/img/logos/*
        - ./web/assets/img/slides/*
        - ./web/assets/img/articles/*
        - ./web/assets/pdf/articles/*
        - ./web/uploads/*
    environments:
        production:
            ssh:
                port: 22
                flags: -i /Users/myuser/.ssh/id_rsa
            rsync: -avz
            user: myuser
            branch: master
            from: ./
            host_path: ./
            hosts:
                - mydomain.com
            pre-deploy:
                #- git/update
                #- composer/install
                #- composer/dump-autoload
                - fs/remove: { file: 'var/cache/prod', flags: '-rf' }
                - fs/remove: { file: 'var/cache/dev', flags: '-rf' }
            on-deploy:
                #- symfony/cache-warmup: { env: 'prod' }
                #- symfony/assets-install: { symlink: true, env: 'prod' }
                #- symfony/assetic-dump: { env: 'dev' }
                - fs/remove: { file: './app/config/parameters.yml' }
                - fs/move: { from: './app/config/parameters.yml.dist', to: './app/config/parameters.yml' }
                - fs/remove: { file: 'var/cache/prod', flags: '-rf' }
                - fs/remove: { file: 'var/cache/dev', flags: '-rf' }
            on-release:
            post-release:
            post-deploy:

My rsync version is:

rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, no prealloc, file-flags

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

Thanks in advance

Rindhal commented 7 years ago

Hello:

I have similar problem and find that rsync works relative to the root folder... if you remove the dot and slash from the begging should work.

Try with caution to update like this:

magephp: log_dir: ./var/logs/mage exclude:

Good Luck!

robertosanval commented 7 years ago

Great!! Thanks for the tip. Problem solved!