# Using Trellis without a repo_subtree_path

**URL:** https://discourse.roots.io/t/using-trellis-without-a-repo-subtree-path/9859
**Category:** trellis
**Created:** 2017-06-23T10:00:04Z
**Posts:** 6

## Post 1 by @silumesii — 2017-06-23T10:00:04Z

Hello!

I’m experimenting with Trellis to find a repository setup that will work best for our team setup.

The documentation describes that `repo_subtree_path` is optional:  
[https://roots.io/trellis/docs/deploys/](https://roots.io/trellis/docs/deploys/)

In my experiment, I have the recommended folder setup but with a separate repo for Trellis, another for Bedrock and `repo_subtree_path` commented out in the staging `wordpress_sites.yml`.

During the deployment step, I get the following error:

> ## TASK [deploy : Fail if composer.json not found] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* System info: Ansible 2.3.1.0; Linux Trellis at “Option to install WP-CLI packages”
> 
> Unable to find a `composer.json` file in the root of ‘/srv/www/example.com/releases/20170623094327’. Make sure your repo has  
> a `composer.json` file in its root or edit `repo_subtree_path` for ‘[example.com](http://example.com)’ in `wordpress_sites.yml` so it points to the  
> directory with a `composer.json` file.  
> fatal: [server]: FAILED! =\> {“changed”: false, “failed”: true}

The error makes sense since there is no `site` subtree in the repository. Is there a recommended way to use Trellis without a `repo_subtree_path` defined?

---

## Post 2 by @swalkinshaw — 2017-06-23T13:51:35Z

What does the folder structure of your `repo` look like?

Trellis needs a `composer.json` to exist in the _root_ of that repo, otherwise you can point it to the path of the Bedrock folder via `repo_subtree_path`.

---

## Post 3 by @fullyint — 2017-06-23T13:54:28Z

I agree with @swalkinshaw’s post above. I had all this typed so I’ll share it anyway…

* * *

> [@silumesii](#):
>
> I have the recommended folder setup but with a separate repo for Trellis, another for Bedrock and `repo_subtree_path` commented out in the staging `wordpress_sites.yml`.

:arrow_up: Normally your steps should work.

Could you try temporarily replacing your staging [`repo`](https://github.com/roots/trellis/blob/5ad51ab279c253bef27898ba321b0133b0344b7b/group_vars/staging/wordpress_sites.yml#L12) value with the following (and leave the `repo_subtree_path` commented out):

```
repo: git@github.com:roots/bedrock.git
```

If deploying this basic bedrock repo succeeds, it suggests that your own repo doesn’t have the composer.json file in the root (perhaps you simply haven’t yet pushed your local git changes to your remote repo?).

If the above test still fails with the same message, could you try temporarily editing the **production** `group_vars/production/wordpress_sites.yml`, replacing the `repo` value again with the basic bedrock repo above and commenting out the `repo_subtree_path`, then run your deploy again, still with `-e env=staging`? If now the deploy succeeds, it suggests that production variables are coming in to play even when you use `-e env=staging`, which would likely be a symptom of [this problem](https://discourse.roots.io/t/production-server-provision-configures-staging-envs-if-hosts-are-the-same-bug-or-intention/6090) (see link for solution).

---

## Post 4 by @silumesii — 2017-06-23T15:41:56Z

Thanks, @swalkinshaw and @fullyint.

Using the Bedrock repo solves the problem.

I think I understand now. The `repo` needs to be a link to a Bedrock project (which should have a `composer.json` in the root). Does this sound about right?

If this is the case, would it make sense to update the docs to make this a bit clearer? I don’t mind submitting some suggestions in a pull request.

---

## Post 5 by @swalkinshaw — 2017-06-23T15:52:41Z

If there’s a place to clarify that then sure :thumbsup:

I guess you thought it pointed to the Trellis repo?

---

## Post 6 by @silumesii — 2017-06-23T16:08:55Z

That’s exactly right, @swalkinshaw! I thought it was the URL to the Trellis repo :sweat_smile:
