-
Notifications
You must be signed in to change notification settings - Fork 1k
Possible to make different aliases to same remote webhost account with only different paths on remote? #5789
Copy link
Copy link
Closed
Description
Documentation does not answer my use case yet
- https://make.wordpress.org/cli/handbook/references/config/#config-files
- 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 defaults
path: /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 defaults
path: ~/Web
@dd:
ssh: dd
path: /data/web/•••/html/apps/dd/
@dds:
ssh: dd
path: /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
@dand@dsrespectively, 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?
Reactions are currently unavailable