This is my first Trellis/Bedrock/Roots project, and I’ve run into and solved a number of issues getting here and I’ve learned tonnes, but now I’m stumped. I’ve got as far as deploying successfully, and then manually run the npm/bower/gulp tasks on the server. Now I’ve uncommented the build-before tasks. The deployment runs into this error:
TASK [deploy : include] ********************************************************
included: /Users/Bed/Sites/find-enlight.com/trellis/deploy-hooks/build-before.yml for 46.101.87.215
TASK [deploy : Run npm install] ************************************************
changed: [46.101.87.215]
TASK [deploy : Run bower install] **********************************************
System info:
Ansible 2.1.1.0; Darwin
Trellis at "Upgrade Ubuntu from 14.04 Trusty to 16.04 Xenial"
---------------------------------------------------
[Errno 2] No such file or directory
fatal: [46.101.87.215]: FAILED! => {"changed": false, "cmd": "bower install", "failed": true, "rc": 2}
And with increased verbosity, just the bower task:
TASK [deploy : Run bower install] **********************************************
task path: /Users/Bed/Sites/find-enlight.com/trellis/deploy-hooks/build-before.yml:13
File lookup using /Users/Bed/.ssh/id_rsa.pub as file
<46.101.87.215> ESTABLISH LOCAL CONNECTION FOR USER: Bed
<46.101.87.215> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1472297631.37-102758408774136 `" && echo ansible-tmp-1472297631.37-102758408774136="` echo $HOME/.ansible/tmp/ansible-tmp-1472297631.37-102758408774136 `" ) && sleep 0'
<46.101.87.215> PUT /var/folders/b7/ndnvqhzn1db3hb9vyktj9bn80000gn/T/tmpLulu4h TO /Users/Bed/.ansible/tmp/ansible-tmp-1472297631.37-102758408774136/command
<46.101.87.215> EXEC /bin/sh -c 'LANG=en_GB.UTF-8 LC_ALL=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 /usr/bin/python /Users/Bed/.ansible/tmp/ansible-tmp-1472297631.37-102758408774136/command; rm -rf "/Users/Bed/.ansible/tmp/ansible-tmp-1472297631.37-102758408774136/" > /dev/null 2>&1 && sleep 0'
System info:
Ansible 2.1.1.0; Darwin
Trellis at "Upgrade Ubuntu from 14.04 Trusty to 16.04 Xenial"
---------------------------------------------------
[Errno 2] No such file or directory
fatal: [46.101.87.215]: FAILED! => {"changed": false, "cmd": "bower install", "failed": true, "invocation": {"module_args": {"_raw_params": "bower install", "_uses_shell": false, "chdir": "../site/web/app/themes/find-enlight-theme", "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "rc": 2}
This is my build-before.yml config:
- name: Run npm install
command: npm install
connection: local
args:
chdir: "{{ project.local_path }}/web/app/themes/find-enlight-theme"
- name: Run bower install
command: bower install
connection: local
args:
chdir: "{{ project.local_path }}/web/app/themes/find-enlight-theme"
- name: Run gulp
command: gulp --production
connection: local
args:
chdir: "{{ project.local_path }}/web/app/themes/find-enlight-theme"
- name: Copy project local files
synchronize:
src: "{{ project.local_path }}/web/app/themes/find-enlight-theme/dist"
dest: "{{ deploy_helper.new_release_path }}/web/app/themes/find-enlight-theme"
group: no
owner: no
rsync_opts: --chmod=Du=rwx,--chmod=Dg=rx,--chmod=Do=rx,--chmod=Fu=rw,--chmod=Fg=r,--chmod=Fo=r
And here’s the staging wordpress-sites.yml config:
wordpress_sites:
find-enlight.com:
site_hosts:
- canonical: staging.find-enlight.com
redirects:
- www.staging.find-enlight.com
local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
repo: git@github.com:thisolivier/find-enlight-combo.git
repo_subtree_path: site
branch: testingmajor
admin_email: my@email.uk
multisite:
enabled: false
ssl:
enabled: false
provider: self-signed
cache:
enabled: false
Bower install runs fine from the theme directory, and if I skip the bower task, the same error occurs for the gulp task. The directory for the project/theme seems to be fine, I think it’s the location the commands are being run from, but since (as far as I understand) the remote server is establishing a connection to my local machine to run these commands, I’m totally lost at what the next debug stage is.