Yes, I’m sorry, should’ve mention that.
I made these changes to ansible/roles/deploy/defaults/main.yml
for the deploy to complete successfully:
project_post_build_commands: []
# - cmd: "composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts"
# Post finalize commands are run with Ansible's `shell` module.
# These are meant primarily for service restarts such as php5-fpm or memcached.
project_post_finalize_commands: []
# - sudo service php5-fpm reload
I executed the composer
command manually (working) and the second commented out line won’t work because of sudo/shared hosting.
A deploy with project_post_build_commands
enabled looks like this:
âžś ansible git:(master) âś— ./deploy.sh staging staging.example.tld
PLAY [Deploy WP site] *********************************************************
GATHERING FACTS ***************************************************************
ok: [staging.example.tld]
TASK: [deploy | Initialize] ***************************************************
ok: [staging.example.tld]
TASK: [deploy | Clone project files] ******************************************
ok: [staging.example.tld]
TASK: [deploy | write unfinished file] ****************************************
changed: [staging.example.tld]
TASK: [deploy | Copy files to new build dir] **********************************
changed: [staging.example.tld]
TASK: [deploy | Move project subtree into root folder] ************************
changed: [staging.example.tld]
TASK: [deploy | Remove unwanted files/folders from new release] ***************
changed: [staging.example.tld] => (item=.git)
changed: [staging.example.tld] => (item=ansible)
changed: [staging.example.tld] => (item=Vagrantfile)
TASK: [deploy | Run pre_build_commands_local on Ansible host] *****************
skipping: [staging.example.tld]
TASK: [deploy | Copy project local files] *************************************
skipping: [staging.example.tld]
TASK: [deploy | Copy project templates] ***************************************
changed: [staging.example.tld] => (item={'dest': '.env', 'src': 'roles/deploy/templates/env.j2', 'name': '.env config'})
TASK: [deploy | Run pre_build_commands in the new_release_path] ***************
skipping: [staging.example.tld]
TASK: [deploy | Check if project folders exist] *******************************
ok: [staging.example.tld] => (item=vendor)
TASK: [deploy | Copy project folders] *****************************************
changed: [staging.example.tld] => (item={'invocation': {'module_name': u'stat', 'module_args': u'path="/home/username/public_html/staging.example.tld/current/vendor"'}, 'item': 'vendor', u'stat': {u'uid': 2058, u'exists': True, u'woth': False, u'mtime': 1434792347, u'inode': 2956294210, u'isgid': False, u'size': 98, u'wgrp': False, u'isuid': False, u'isreg': False, u'pw_name': u'username', u'gid': 2053, u'ischr': False, u'wusr': True, u'xoth': True, u'rusr': True, u'nlink': 6, u'issock': False, u'rgrp': True, u'gr_name': u'username', u'path': u'/home/username/public_html/staging.example.tld/current/vendor', u'xusr': True, u'atime': 1434792347, u'isdir': True, u'ctime': 1434792347, u'isblk': False, u'xgrp': True, u'dev': 64771, u'roth': True, u'isfifo': False, u'mode': u'0755', u'islnk': False}, u'changed': False})
TASK: [deploy | Ensure shared sources are present] ****************************
changed: [staging.example.tld] => (item={'path': 'web/app/uploads', 'src': 'uploads'})
TASK: [deploy | Ensure shared paths are absent] *******************************
changed: [staging.example.tld] => (item={'path': 'web/app/uploads', 'src': 'uploads'})
TASK: [deploy | Create shared symlinks] ***************************************
changed: [staging.example.tld] => (item={'path': 'web/app/uploads', 'src': 'uploads'})
TASK: [deploy | Run post_build_commands in the new_release_path] **************
failed: [staging.example.tld] => (item={'cmd': 'composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts'}) => {"cmd": "composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts", "failed": true, "item": {"cmd": "composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts"}, "rc": 2}
msg: [Errno 2] No such file or directory
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/Users/scherii/deploy.retry
staging.example.tld : ok=13 changed=9 unreachable=0 failed=1
Thanks for the project_unwanted_items
!
Shouldn’t that be in https://github.com/roots/bedrock-ansible/blob/master/group_vars/all as well?
Or is it just because my git repo includes the whole project folder (ansible
and site
), like subtree: site
?