# Deployment with the new Trellis hooks

**URL:** https://discourse.roots.io/t/deployment-with-the-new-trellis-hooks/5016
**Category:** trellis
**Created:** 2015-10-13T17:28:59Z
**Posts:** 16
**Showing post:** 2 of 16

## Post 2 by @swalkinshaw — 2015-10-14T16:42:26Z

Thanks for pointing out the outdated example project docs. Would you mind opening an issue on that repo as a reminder?

Couple points:

- Per the [docs](https://roots.io/trellis/docs/deploys/) you should keep your custom hooks outside of the `roles` folder. Example: `deploy_build_before: "{{ playbook_dir }}/deploy-hooks/build-before.yml"`

- If you were using the `local` commands before, you’ll need to add some additional things to the hook file to make them run locally. And you still want to use `project.local_path`.

```
---
- name: Run npm install
  command: npm install
  connection: local
  args:
    chdir: "{{ project.local_path }}/web/app/themes/footprint"
- name: Run bower install
  command: bower install
  connection: local
  args:
    chdir: "{{ project.local_path }}/web/app/themes/footprint"
- name: Run gulp
  command: gulp --production
  connection: local
  args:
    chdir: "{{ project.local_path }}/web/app/themes/footprint"
- name: Copy project local files
  synchronize: src="{{ item.src }}"
               dest="{{ deploy_helper.new_release_path }}/{{ item.dest }}"
               group=no
               owner=no
               rsync_opts=--chmod=Du=rwx,--chmod=Dg=rx,--chmod=Do=rx,--chmod=Fu=rw,--chmod=Fg=r,--chmod=Fo=r
  with_items:
  - src: "{{ project.local_path }}/web/app/themes/footprint/dist"
    dest: web/app/themes/sage
```

---

_[View the full topic](https://discourse.roots.io/t/deployment-with-the-new-trellis-hooks/5016)._
