wesleytodd / YeoPress

A Yeoman generator for WordPress
Other
1.08k stars 161 forks source link

Deploying Yeopress #18

Open mastef opened 11 years ago

mastef commented 11 years ago

More of a question on process to make this also easier for anybody else who's interested in this generator.

What would be the current process of deploying the locally developed YeoPress to a staging/production environment with the database?

How do you do it yourself currently?

rossedman commented 11 years ago

I might be speaking out of turn but I personally deploy Yeopress and then have a git system set up where as pull requests are merged and accepted into the master branch they then push live through FTP to a server automatically. I use a remote database at all times and use one database at all times. This is the only part of my process I despise.

mastef commented 11 years ago

Yes, that's not so optimal unfortunately. We need a proper process for database migration

rossedman commented 11 years ago

I agree. Wordpress seems so limiting on this. I really like the way Laravel handles it. Would love to see something similar but not sure the amount of work required to do that.

wesleytodd commented 11 years ago

@redata425 Not out of turn at all, thanks for the input! I think the problem of file deployment is pretty well solved using git. Which I why it is a prominent option. The database is a totally different story.

There is a pretty handy little SQL script I use currently, but this is a manual thing. My goal is to integrate options for local and remote development into YeoPress so that all you have to do is run something like $ grunt migrate production. It might ask you some questions, but other than that it will just do a git deploy of the files, and migrate the database.

In the mean time, I have heard great things about this plugin: http://deliciousbrains.com/wp-migrate-db-pro/

From their site:

WP Migrate DB Pro eliminates the manual work of migrating a WP database.

Copy your db from one WP install to another with a single-click in your dashboard.

Especially handy for syncing a local development database with a live site.

wesleytodd commented 11 years ago

Actually, maybe it would be a good idea to reach out to those guys and see what they think about doing some sort of team up to get an all in one solution to this problem. What do you think @deliciousbrains?

rossedman commented 11 years ago

Actually my company just got a WP Migrate DB Pro license and it seems pretty amazing. Love what I have seen so far. Maybe this could be tied into WP CLI or a Grunt task?

edlefebvre commented 11 years ago

Hi guys, maybe you should have a look to what Mark Jaquith does for deploying matters (capistrano section): https://github.com/markjaquith/WP-Stack. I don't really know if it can work along with YeoPress but it is a very good ressource anyway.

rossedman commented 11 years ago

@edlefebvre Thanks for the resource! I actually have this starred and must have not looked into it too much.

duanecilliers commented 11 years ago

@edlefebvre I am interested in integrating WP-Stack with Yeopress.

WordPress-Skeleton's (https://github.com/markjaquith/WordPress-Skeleton) structure is almost identical to Yeopress, shouldn't be too difficult using https://github.com/roots/capistrano-grunt after installing the capistrano gem via puppet.

@wesleytodd WP Migrate DB Pro is amazing at keeping two sites "synced", but doesn't seemlessly do an initial import of the database. It would be sweet if YeoPress built the Wp-Stack config files based on input from YeoPress options.

I was thinking there are two ways of integrating WP-Stack with YeoPress...

  1. If yo wordpress is run with the --advanced flag. Prompt: [?] Would you like to create a deploy script? (N). If yes, Create a deploy directory and add the necessary prompts to build the config files.
  2. Create as a sub generator

Thoughts?

Once installed, you'd have access to the following commands $ grunt deploy | $ grunt deploy:production | $ grunt deploy:staging etc.

Am I missing anything? Any suggestions welcome, I'll be starting on this soon.

wesleytodd commented 11 years ago

@duanecilliers Sound awesome! Thanks for both the interest and the willingness to give back.

For the preferred method, I think that a sub-generator would be best. I started on a theme generator but have not had time to finish. And I would really like to keep the main install path simple. I was also considering moving the vagrant stuff into a sub generator, so that would fit right in with your addition.

How does WP-Stack handle multiple database configurations? Just ignoring the wp-config.php and requiring you to set it up in both places? I was hoping to have something that still allowed for versioning of the config file since there are other important settings in there.

Also, since it would be a sub-generator, how do you plan on configuring the grunt tasks if the gruntfile already exists? Slipping the new config into the right place?

edlefebvre commented 11 years ago

@wesleytodd Have a look at wordpress-skeleton (https://github.com/markjaquith/WordPress-Skeleton/blob/master/wp-config.php).

The wp-config file checks if a local-config.php exists (with local DB credentials), if not it uses the default DB credentials. You can extend this to several config files, for example a staging-config.php with the appropriate credentials. This way you can keep wp-config within your git and just ignore the other *-config.php files.

duanecilliers commented 11 years ago

@wesleytodd There isn't a Gruntfile in the root!? The deployment Gruntfile could be created in the root directory or maybe it's best to place it in the deploy (or whatever the user names it) directory, then you'd need to cd to deploy before running any deploy commands.

I don't think it will be as simple as a sub generator, take wp-config.php for example... We need to add something like Wordpress-Skeleton's wp-config.php as @edlefebvre mentioned. It's not a huge change, but I don't think a sub generator will work unless someone has an idea for the sub generator to overwrite the database section?

wesleytodd commented 11 years ago

55071cf6a39f7983b48e1adfe6eb34c8db6e0042 I added what @edlefebvre mentioned just a bit ago. Is that what you needed?

And yes, there is no gruntfile in the root currently. But my plan is to move it there based on requests from users. Don't worry about it for now since it is not there currently, but once I move it there we will have to figure something out.

duanecilliers commented 11 years ago

@wesleytodd awesome!

Its formatted slightly differently but im sure i can make it work.

I should have time on tuesday to start on this.

wesleytodd commented 10 years ago

@duanecilliers Any progress on that? I am sure the community that id developing around this generator would love to see more help with methods for deployment (see #69).

duanecilliers commented 10 years ago

Unfortunately I haven't had much time :(

I'm still keen to give it a shot because I use your generator on almost every project.

Adding it to my schedule now, will keep you guys posted.

wesleytodd commented 10 years ago

Thanks for the update @duanecilliers!

Chrisedmo commented 9 years ago

@duanecilliers @wesleytodd This collaboration sounds great.

👍

Toddses commented 9 years ago

This is something I have thought about a lot too. WP Stack hasn't been updated in a while and is using Capistrano 2 it looks like. Cap3 really changes up the tool. I wrote a Capistrano3 deployer for WordPress that does some of the things requested here, but this requires SSH access. (https://github.com/Toddses/capify-press)

What I'd really like to do is create a WordPress toolkit that incorporates YeoPress, a capistrano deployment tool, and a git ftp deployment tool. Sort of an all-in-one WordPress management toolkit, where you can easily push and pull assets and databases between multiple environments.

duanecilliers commented 9 years ago

@Toddses, I've been wanting to work on something like this for a while. Time has been scarce, so I usually just manually set up deployment per project depending on server environment.

I realize that this is going to cost me more time in the long run, so I'm really keen to get something like this setup.

Capify-Press looks good.