You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently does not answer my particular use of aliases, hence I ask here.
Server side
Accessing production vs. staging in the shell on the server (via SSH)
$ ssh dd
# I'm now on my webhost, executing commands there.
$ wp @dd option get blogname
DD
$ wp @dds option get blogname
DDS
✅ The different aliases return different results, each corresponding to their respective WordPress instance.
~/.wp-cli/config.yml (Webhost)
# Global parameter defaultspath: /data/web/•••/html/apps/dd/# Aliases@dd:path: /data/web/•••/html/apps/dd/@dds:path: /data/web/•••/html/apps/dd-staging/
Client side (Mac)
Client side aliases to access different WP instances (production and staging-subdomain) on the very same remote webhost and very same user account there
I'm now on my Mac.
Running my local wp-cli which connects to the remote wp-cli.
This worked fine when I only had 1 WordPress instance on that webhost account.
For a while I used a production and a staging server with aliases on the server, as shown in the previous section. Worked fine all time.
Now I had set up two aliases on my client side machine corresponding to those two remote instances too.
❌ But both aliases seem to resolve to the same WP instance on the remote!
$ wp @dd option get blogname
DD
$ wp @dds option get blogname
DD
❌ The last command should have returned "DDS" but returned "DD".
I have my dounbts that the aliases resolve correctly.
See my client config:
~/.wp-cli/config.yml (Mac)
# Global parameter defaultspath: ~/Web@dd:ssh: ddpath: /data/web/•••/html/apps/dd/@dds:ssh: ddpath: /data/web/•••/html/apps/dd-staging/
Questions
Is it a problem that I use the same alias names client side as server side?
I rather rule that out.
I temporarily set my client side aliases to @d and @ds respectively, but it made no difference.
Still got the same blogname for both, depsite them being different in reality.
Is the same SSH connection but different paths not enough to constitute two indeed different valid aliases?
The text was updated successfully, but these errors were encountered:
In honesty, I wrote the aliases implementation and have no memory to how it works.
😂 Honesty appreciated! 👍
We'll see if some other contributor can help out.
Ok. No hurry anyways.
Practically I usually anyhow ssh myhost and then wp @alias1 cmd or wp @alias2 cmd.
Directly calling wp @alias1-on-myhost vs. wp @alias2-on-myhost mostly has relevance for use cases where on one's local machine one can/shall only execute wp and not ssh.
Documentation does not answer my use case yet
Server side
Accessing production vs. staging in the shell on the server (via SSH)
$ ssh dd # I'm now on my webhost, executing commands there. $ wp @dd option get blogname DD $ wp @dds option get blogname DDS
~/.wp-cli/config.yml (Webhost)
Client side (Mac)
Client side aliases to access different WP instances (production and staging-subdomain) on the very same remote webhost and very same user account there
~/.wp-cli/config.yml (Mac)
Questions
Is it a problem that I use the same alias names client side as server side?
@d
and@ds
respectively, but it made no difference.Is the same SSH connection but different paths not enough to constitute two indeed different valid aliases?
The text was updated successfully, but these errors were encountered: