enonic / cli-enonic

GNU General Public License v3.0
41 stars 1 forks source link

Alias for dev mode #273

Closed espen42 closed 3 years ago

espen42 commented 3 years ago

Continuous build + running XP in dev mode seems popular, but the commands that need to run together are a mouthful -

enonic sandbox start --dev
enonic project gradle deploy --continuous

We could make this easier and more intuitive to use by adding two aliases to the CLI:

enonic sandbox dev
enonic project dev
alansemenov commented 3 years ago

dev is not a command, it's a mode. So I believe doing sandbox dev will be confusing. It will be even more confusing to do project dev because dev here won't be the same as dev for the sandbox, since continuous deployment of an app doesn't have anything to do with running xp/sandbox in the dev mode (you can continuously deploy with or without the dev mode).

So I suggest we keep sandbox start --dev since it makes perfect sense and implement --c option for project deploy which will run gradle deploy --continuous.

Then you can start xp in dev mode and start continuous deploy with one command: project deploy --dev --c

pmi commented 3 years ago

Then you can start xp in dev mode and start continuous deploy with one command: project deploy --dev --c

Unfortunately you can not do it with one command because deploy -c and start --dev are both long running commands that occupy terminal output indefinitely 😞

pmi commented 3 years ago

The only way we can both deploy continuous and start a sandbox in the same window is when sandbox is started in a detached mode (no output to console)

pmi commented 3 years ago

I tested it a little and running sandbox in detached mode whenever there's a --continuous flag worked fine apart from the fact, that I kept forgetting to stop it after project deploy --continuous ended.

So I added a prompt after project deploy --continuous finishes to stop that detached sandbox. Works pretty smoothly now.