This commit is contained in:
Chris Cheetham 2020-03-25 15:56:16 -04:00
Родитель 0476ea3c78
Коммит 9fa324a198
4 изменённых файлов: 33 добавлений и 3 удалений

Просмотреть файл

@ -87,7 +87,6 @@ namespace Steeltoe.Cli
private static void OutputToConsole(string output)
{
if (!Settings.VerboseEnabled) return;
var oldFg = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.Out.WriteLine(output);

Просмотреть файл

@ -39,7 +39,7 @@ See Also:
protected override Controller GetController()
{
throw new NotImplementedException();
return new StopController();
}
}
}

Просмотреть файл

@ -63,7 +63,6 @@ namespace Steeltoe.Tooling
private static void OutputToConsole(string output)
{
if (!Settings.VerboseEnabled) return;
var oldFg = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Blue;
Console.Out.WriteLine(output);

Просмотреть файл

@ -0,0 +1,32 @@
// Copyright 2020 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace Steeltoe.Tooling.Controllers
{
/// <summary>
/// Controls the "stop" operation.
/// </summary>
public class StopController : Controller
{
/// <summary>
/// Stops the project in the local Docker environment.
/// </summary>
protected override void Execute()
{
var project = GetProject();
var cli = new Cli("docker-compose", Context.Shell);
cli.Run("down", $"stopping '{project.Name}' in Docker");
}
}
}