Skip to content

Instantly share code, notes, and snippets.

@corbanbrook
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save corbanbrook/5747dea4caed33bc89ba to your computer and use it in GitHub Desktop.

Select an option

Save corbanbrook/5747dea4caed33bc89ba to your computer and use it in GitHub Desktop.
Upgrade all sites from one cr to another
fromTag = 'v0.1.19';
toTag = 'v0.1.20';
$injector.get('CodeRevisionResource').all().then(function(codeRevisions) {
cr = _.findWhere(codeRevisions, {tag: fromTag});
$injector.get('SiteResource').indexByCodeRevision(cr.id, true).then(function(sites) {
_.each(sites, function(site) {
site.upgrade(toTag, '[email protected]:pressly/ng-pressilla.git').then(function(res) {
console.log(res.id, 'scheduled for upgrade');
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment