I was trying to add bower install, npm install, and gulp --production after the composer update command when doing a deploy. When it gets to the bower install, I get a failed error “no such file or directory”. However when I login and run bower install as the web account in the theme folder, it works just fine?
Here is my new build-after.yml
file:
---
- name: Check for composer.json in project root or project_subtree_path
stat:
path: "{{ deploy_helper.new_release_path }}/composer.json"
register: composer_json
- name: Fail if composer.json not found
fail:
msg: "Unable to find a `composer.json` file in the root of '{{ deploy_helper.new_release_path }}'. Make sure your repo has a `composer.json` file in its root or edit `subtree_path` for '{{ site }}' in `wordpress_sites.yml` so it points to the directory with a `composer.json` file."
when: not composer_json.stat.exists
- name: Install Composer dependencies
command: composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts
args:
chdir: "{{ deploy_helper.new_release_path }}"
- name: Install bower
command: bower install
args:
chdir: "{{ deploy_helper.new_release_path }}/web/app/themes/nwb"
- name: Install npm
command: npm install
args:
chdir: "{{ deploy_helper.new_release_path }}/web/app/themes/nwb"
- name: Build Project with gulp
command: gulp --production
args:
chdir: "{{ deploy_helper.new_release_path }}/web/app/themes/nwb"
I ran the deploy with the -vvv switch, checked the path manually, and it’s the right path to the theme folder. Checked bower install can be run from all accounts, and that was fine too.