-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposed solution for Issue #22 App upgrade/update command #52
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,11 @@ function valkyrie_drush_command() { | |
'aliases' => array('vup'), | ||
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap at all. | ||
); | ||
|
||
$items['valkyrie-upgrade'] = array( | ||
'description' => 'Upgrade global Valkyrie extension and all of the submodules.', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need to mention submodules |
||
'aliases' => array('vug'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we need an alias. In fact, it might be a good idea to force someone to type it out, since it is potentially destructive. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by default, this should probably be equivalent to 'drush dl valkyrie'. That is, download and install the release tarball. Maybe add a --git option, to optionally switch to, or update a git version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is a little ambiguous to me, needing some clearing up on it. If we need to download the latest release tarball, I feel like we will need something like Possibly I overcomplicated this, and we are going to explicitly call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default It also allows us to switch to git, which is the point of #22. This'll allow users to easily test feature branches, bug fixes, or just live on the bleeding edge. However, once we're using the git version, we should be able to switch back to releases, if more stability is desired. We can check for the presence of Eventually, it might be nice to provide an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great explanation this clears it up 100% for me. Thanks! |
||
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap at all. | ||
); | ||
$items['valkyrie-platform-add'] = array( | ||
'description' => 'Register an existing platform with Valkyrie', | ||
'arguments' => array( | ||
|
@@ -346,6 +350,20 @@ function drush_valkyrie_update() { | |
} | ||
} | ||
} | ||
function drush_valkyrie_upgrade() { | ||
$current_path = getcwd(); | ||
$src = dirname(__FILE__); | ||
if($src != $current_path) { | ||
drush_print('You need to be in (~/.drush/valkyrie) to do this'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check out |
||
} | ||
else { | ||
drush_print('Checking for updates...'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are a number of things that we might want to do here, in addition. For example, ensure that we're on the correct branch. We might also want to add I'd suggest that we use |
||
drush_shell_proc_open('git pull'); | ||
drush_print('Checking submodule updates...'); | ||
drush_shell_proc_open('git submodule update --init --recursive'); | ||
drush_log('Upgrade Finished', 'ok'); | ||
} | ||
} | ||
|
||
/** | ||
* Command callback for the 'valkyrie-snapshot' command. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we're doing lots of other updating and upgrading, I'd suggest 'valkyrie-self-upgrade' or '...-self-update'.