svenluijten / forge-cli

🔥 A command line utility to interact with your Laravel Forge servers, sites, and more.
https://svenluijten.com
MIT License
64 stars 14 forks source link

return site id when making a new site #43

Closed sebszocinski closed 3 years ago

sebszocinski commented 4 years ago

We're trying to automate a deployment bash script that makes a new site, installs a repo and then runs deployments.

Currently we need to do some manual work to provide the site id after we create it. Is there any output the id or save it to a config file?

nvahalik commented 4 years ago

There is not, but you can run a script like this to grab the site ID/IP:

SERVER_ID=$(forge server:list | grep <my-server-name> | cut -f 3 -d'|' | sed -e 's/^[[:space:]]*//'  -e 's/[[:space:]]*$//')
SERVER_IP=$(forge server:list | grep <my-server-name> | cut -f 4 -d'|' | sed -e 's/^[[:space:]]*//'  -e 's/[[:space:]]*$//')

Note that these work alongside this PR: #44.

svenluijten commented 3 years ago

Closing because I am abandoning this package in favor of laravel/forge-cli.