1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00

Add possible values and default (#5030)

This commit is contained in:
Daniel Mieg
2024-08-29 10:55:43 +02:00
committed by GitHub
parent ff86369e95
commit cb45ad1b44
2 changed files with 7 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ type abapEnvironmentCloneGitRepoOptions struct {
Password string `json:"password,omitempty"`
ByogUsername string `json:"byogUsername,omitempty"`
ByogPassword string `json:"byogPassword,omitempty"`
ByogAuthMethod string `json:"byogAuthMethod,omitempty"`
ByogAuthMethod string `json:"byogAuthMethod,omitempty" validate:"possible-values=TOKEN BASIC"`
Repositories string `json:"repositories,omitempty"`
RepositoryName string `json:"repositoryName,omitempty"`
BranchName string `json:"branchName,omitempty"`
@@ -145,7 +145,7 @@ func addAbapEnvironmentCloneGitRepoFlags(cmd *cobra.Command, stepConfig *abapEnv
cmd.Flags().StringVar(&stepConfig.Password, "password", os.Getenv("PIPER_password"), "Password for either the Cloud Foundry API or the Communication Arrangement for SAP_COM_0948")
cmd.Flags().StringVar(&stepConfig.ByogUsername, "byogUsername", os.Getenv("PIPER_byogUsername"), "Username for bring your own git (BYOG) authentication")
cmd.Flags().StringVar(&stepConfig.ByogPassword, "byogPassword", os.Getenv("PIPER_byogPassword"), "Password for bring your own git (BYOG) authentication")
cmd.Flags().StringVar(&stepConfig.ByogAuthMethod, "byogAuthMethod", os.Getenv("PIPER_byogAuthMethod"), "Specifies which authentication method is used for bring your own git (BYOG) repositories")
cmd.Flags().StringVar(&stepConfig.ByogAuthMethod, "byogAuthMethod", `TOKEN`, "Specifies which authentication method is used for bring your own git (BYOG) repositories")
cmd.Flags().StringVar(&stepConfig.Repositories, "repositories", os.Getenv("PIPER_repositories"), "Specifies a YAML file containing the repositories configuration")
cmd.Flags().StringVar(&stepConfig.RepositoryName, "repositoryName", os.Getenv("PIPER_repositoryName"), "Specifies a repository (Software Components) on the SAP BTP ABAP Environment system")
cmd.Flags().StringVar(&stepConfig.BranchName, "branchName", os.Getenv("PIPER_branchName"), "Specifies a branch of a repository (Software Components) on the SAP BTP ABAP Environment system")
@@ -245,7 +245,7 @@ func abapEnvironmentCloneGitRepoMetadata() config.StepData {
Type: "string",
Mandatory: false,
Aliases: []config.Alias{},
Default: os.Getenv("PIPER_byogAuthMethod"),
Default: `TOKEN`,
},
{
Name: "repositories",

View File

@@ -84,6 +84,10 @@ spec:
- STAGES
- STEPS
- GENERAL
possibleValues:
- TOKEN
- BASIC
default: TOKEN
- name: repositories
type: string
description: Specifies a YAML file containing the repositories configuration