1 Commits

Author SHA1 Message Date
Matthias Langhard
9c313526e7 feat: implements option to add a service-name when initializing first tag 2021-11-04 08:22:09 +01:00
3 changed files with 23 additions and 17 deletions

View File

@@ -1,26 +1,18 @@
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
stages:
- test
- publish
- test
- publish
running tests for tag:
image: mcr.microsoft.com/dotnet/sdk:5.0
stage: test
script:
- dotnet test tests/update-tag.tests
- dotnet test tests/update-tag.tests
publish to nuget:
only:
- "/^\\d*.\\d*.\\d*$/"
- /^\d*.\d*.\d*$/ # gets triggered if the commit tag is in the form n.n.n where n is any number
image: mcr.microsoft.com/dotnet/sdk:5.0
stage: publish
script:
- dotnet pack src/Cli -o ./packaged
- dotnet nuget push ./packaged/*.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml
- dotnet pack src/Cli -o ./packaged
- dotnet nuget push ./packaged/*.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json

View File

@@ -103,6 +103,15 @@ namespace Cli
new Selection("no", null)
)
);
var serviceName = AnsiConsole.Prompt(
new TextPrompt<string>("[grey][[Optional]][/] Enter [green]service name[/]:")
.AllowEmpty()
);
if (!string.IsNullOrWhiteSpace(serviceName))
{
selection.Version.SetService(serviceName.Trim());
}
}
if (selection.Version == null)

View File

@@ -57,7 +57,7 @@ namespace Application.Models
public int Minor { get; private set; }
public int Patch { get; private set; }
public int? Rc { get; private set; }
public string Service { get; }
public string Service { get; private set; }
public override string ToString()
@@ -198,5 +198,10 @@ namespace Application.Models
{
return Rc != null;
}
public void SetService(string service)
{
Service = service;
}
}
}