craftcms / nitro

Speedy local dev environment for @craftcms.
https://getnitro.sh
MIT License
178 stars 24 forks source link

Nitro Up... Shrink wrap the devops #348

Closed khalwat closed 3 years ago

khalwat commented 3 years ago

A fantastic feature of Docker is that you can "shrink wrap" the devops of a project as config. So I can onboard someone by telling them to just pull down a Git repo, and type a single command, e.g.:

docker-compose up

or

make dev

...or the like, and it'll do everything that needs doing to spin up the local dev environment.

With Nitro currently, people have to clone the project down, have Nitro installed, and then create a new site, database, etc. for each project, so there's no way to have that zero-friction onboarding.

I'd love to see something in Nitro that'd be similar, e.g.:

nitro up

...and maybe as a bonus there being a way to specify a directory for the seed database when the project is first started up (or even better, a way to pull a database down from somewhere).

jasonmccallister commented 3 years ago

@khalwat I'm a little confused by this feature request. We have nitro init that will create everything a developer needs, some of how that works is documented here.

The nitro start|stop commands along with apply will ensure everything is matched based on the configuration file.

We also have planned to add support for project specific configs that can be included in the git repository for the project to allow teams to share configs (https://github.com/craftcms/nitro/issues/259).

We also have the create command which allows passing a repository and sets up the database. Part of #259 will increase the automation of the db creation and setup.

...and maybe as a bonus there being a way to specify a directory for the seed database when the project is first started up (or even better, a way to pull a database down from somewhere).

I'm not sure this is a Nitro concern, I would not want to automatically seed a database when running a command. I have seen people using composer scripts to meet this functionality, this allows them to run nitro composer <script> to automate that process for them. That would vary greatly from team to team so we should be careful not to enforce a workflow if that makes sense?

Can you elaborate on this feature because I'm sure I'm looking at it but clearly missing the intent :)

khalwat commented 3 years ago

We also have planned to add support for project specific configs that can be included in the git repository for the project to allow teams to share configs (#259).

Right, this is what I'm referring to. With a pure Docker setup, it's easy to automate all of this, which makes onboarding wonderful. I'm glad you have plans for it.

Currently, there's no way automated way to do this.

I'm not sure this is a Nitro concern, I would not want to automatically seed a database when running a command. I have seen people using composer scripts to meet this functionality, this allows them to run nitro composer Githubissues.

  • Githubissues is a development platform for aggregating issues.