Closed jaruba closed 4 years ago
Another thought I have about this is that we could save this data in JSON, example:
{
"server": "...",
"github": "..."
}
We could use beamup --set-server <hostname> --set-user <github user>
to create a global beamup.json
, but also allow creating a beamup.json
in the project folder (that users will want to deploy) to allow setting per project settings.
The good thing about this is that it's scalable to any number of future settings we might add.
Further thoughts:
grep
could be used to extract JSON values from files, see:
https://stackoverflow.com/questions/1955505/parsing-json-with-unix-tools#answer-6852427echo
and save JSON by simply hardcoding it, see: https://stackoverflow.com/questions/39895965/how-to-write-json-file-using-bash#answer-39896024beamup.json
to a different project to keep the settingsMy final thoughts on this:
beamup config <server> <github>
and used globallybeamup
without a config file, it should ask for a server and github itself and create the config filebeamup init
should create beamup.json
in the project folder with the project folder name as the addon name, alternatively beamup init <addon name>
can be used to create a beamup.json
file with a custom addon namebeamup
and there is a config file available, but not a beamup.json
in the project's path, then it should ask if the project folder name should be used as the addon name, if agreed (or set to a different value) then a beamup.json
file will be created and the process will continueThis should make it as simple as just using beamup
to deploy, or init, or even config, as this one command will handle all possible scenarios.
A separate project has been built for this purpose: beamup-cli
Scenario
The current proposed command is
./cli/beamup <beamup deployer hostname> add-remote <github username> <addon name>
IMO this is an issue, as addon devs will always need to search for the hostname and add their github user every time they initiate a new addon.
Proposed Solution
beamup --set-server <hostname> --set-user <github user>
to set both the server and user as the default for all future use.