internal void GenerateDeploy() { var allDeltas = _deltasRepository.GetAllDeltas(); var applicableDeltas = allDeltas.OrderBy(d => d.Number) .Where(d => d.Number >= _fromDelta) .Where(d => d.Number <= _toDelta) .ToList(); if (applicableDeltas.Any()) { Print("[mldeploy] Generating deploy script for deltas ", applicableDeltas); _scriptRepository.GenerateDeployScriptFor(applicableDeltas); } else { Console.WriteLine("[mldeploy] No deltas applicable to generate script"); } }
internal void Deploy() { var allDeltas = _deltaRepository.GetAllDeltas() .OrderBy(d => d.Number); Print("[mldeploy] Deltas found: ", allDeltas); var latestDeltaInDatabase = _deployRepository.GetLatestDeltaInDatabase(); var applicableDeltas = allDeltas.Where(delta => delta.Number > latestDeltaInDatabase.Number) .OrderBy(delta => delta.Number); Print("[mldeploy] Deltas applicable: ", applicableDeltas); foreach (var delta in applicableDeltas) { _deployRepository.ApplyDelta(delta); _deployRepository.UpdateLatestDeltaAs(delta); } }