Skip to content

Instantly share code, notes, and snippets.

@PaulStovell
Created January 8, 2012 13:28
Show Gist options
  • Select an option

  • Save PaulStovell/1578363 to your computer and use it in GitHub Desktop.

Select an option

Save PaulStovell/1578363 to your computer and use it in GitHub Desktop.
public class EnvironmentsController : OctopusController
{
readonly IDataContext dataContext;
public EnvironmentsController(IDataContext dataContext)
{
this.dataContext = dataContext;
}
public ActionResult Index()
{
var environments = dataContext.Set<DeploymentEnvironment>()
.Include(m => m.Machines)
.Include(m => m.Variables)
.OrderBy(m => m.SortOrder)
.ToList();
var upgradeNeeded = environments.SelectMany(m => m.Machines).Any(x => x.NeedsUpgrading ?? false);
if (upgradeNeeded)
{
ViewData.FlashWarning("One or more of your machines below appear to be running old versions of Octopus Tentacle. Please use the \"Upgrade All\" button above to upgrade them. Or, use the \"Check Health\" button to refresh the version numbers.");
}
return View(new EnvironmentListModel(environments));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment