Fail if composer.json not found

This is the tree(ish) of my wordpress_sites: repo repository:

├── LICENSE
├── README.md
├── site
│   ├── CHANGELOG.md
│   ├── CONTRIBUTING.md
│   ├── LICENSE.md
│   ├── README.md
│   ├── composer.json
│   ├── composer.lock
└── trellis

And wordpress_sites look like this:

wordpress_sites:
  hostname.com:
    site_hosts:
      - hostname.com
    local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
    repo: git@github.com:username/DeLaPie.git # replace with your Git repo URL
    repo_subtree_path: site # relative path to your Bedrock/WP directory in your repo

Why am I getting a composer.json not found error?

The answer was that my repo was treating the site directory as a submodule, linking to I’m not sure what.

I didn’t see a .git/modules directory. Ended up moving the site directory up a directory (above the git repo). Creating an empty directory called site and running git rm site, then “added” the site directory back by moving it back into the repo and git add -A, git commit -a, etc.

Now deploy works.

1 Like