Staging: Completely different URL?

Does Trellis support this?

DOMAIN1.com:
    site_hosts:
      - canonical: DOMAIN1.DOMAIN2.com

That’s what I have in my /trellis/group_vars/staging/wordpress_sites.ymlfile yet when I run ./bin/deploy.sh staging DOMAIN1.DOMAIN2.com I get this:

TASK [connection : Load become password] ***************************************************************************************************************************************************************************
skipping: [99999999.222]

PLAY [Deploy WP site] **********************************************************************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************************************************************
ok: [99999999.222]

TASK [Ensure site is valid] ****************************************************************************************************************************************************************************************
System info:
  Ansible 2.3.0.0; Darwin
  Trellis at "Accommodate child themes: Update WP `stylesheet_root` separately"
---------------------------------------------------
Site `DOMAIN1.DOMAIN2.com` is not valid. Available sites to deploy:
DOMAIN1.com
fatal: [9999999.222]: FAILED! => {"changed": false, "failed": true}
        to retry, use: --limit @/Users/Mark/Sites/xxxxxxx/trellis/deploy.retry

PLAY RECAP *********************************************************************************************************************************************************************************************************
999999.222              : ok=2    changed=0    unreachable=0    failed=1

I even setup a redirect and was given the same error.

Thoughts?

You need to run the following command:

./bin/deploy.sh staging DOMAIN1.com

The top-level item you have in wordpress_sites.yml (DOMAIN1.com in this case) is just the name of that site, it doesn’t reflect the actual domain where it will appear, but it is used as the name when you want to deploy that site. You can make it whatever you want, more or less. The following would, in theory, also work, and would deploy a site to DOMAIN1.DOMAIN2.com:

SuperCoolSite:
    site_hosts:
      - canonical: DOMAIN1.DOMAIN2.com
./bin/deploy.sh staging SuperCoolSite
3 Likes

Oh DUH, thanks!

Appreciate the help!