Add `site update` command #110

Merged
merged 4 commits into from Jan 12, 2017

Projects

None yet

3 participants

@mjangda
Member
mjangda commented Jan 11, 2017 edited

Triggers an upgrade_wp action for the given site and provides progress on container state throughout.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Triggering web server update/rebuild:
-- Site: example.com (#309)
-- Environment: production
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Successfully created wp upgrade host action for site 123 (action #123456)

## Container Status (updated 2017-01-11T19:33:38.406Z):
#10006 - example-comgo-vipco_web_0004 - running
#10007 - example-comgo-vipco_web_0005 - running

## wp-cli Status:
Action #123456: queued
Update complate 🎉🎉🎉

We wait for the core update-db host action to complete as the signal that we're done. The Container Status and wp-cli Status sections update throughout the process.

@mjangda mjangda Add `site update` command
Triggers an `upgrade_wp` action for the given site and provides progress
on container state throughout.
01f7706
+const api = require( '../lib/api' );
+
+export function update( site ) {
+ return new Promise( ( resolve, reject ) => {
@joshbetz
joshbetz Jan 11, 2017 Member

We should add the minimum required node version to package.json and ensure all sandboxes are on the minimum version for Promises.

@mjangda
mjangda Jan 11, 2017 Member

Sure. Looks like supports been in since v0.12.1 (http://node.green/#Promise)

@ethitter
Member

Not sure if it's specific to this command, but there should be some validation applied to the site ID input. I typo'd a = onto one and it made the API query, which then errored.

@mjangda
Member
mjangda commented Jan 11, 2017

There's one small bug where the status of wp-cli command can still show as "queued" (we don't do a final update before showing the error).

@mjangda mjangda When an action completes, mark it as such
Otherwise we sometimes end with its state still being listed as "queued"
ddbf788
@mjangda
Member
mjangda commented Jan 11, 2017

There's one small bug where the status of wp-cli command can still show as "queued"

Should be fixed in ddbf788

@mjangda mjangda merged commit d5b8cba into master Jan 12, 2017
@mjangda mjangda deleted the add/upgrade branch Jan 12, 2017
@joshbetz joshbetz removed the needs review label Jan 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment