1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-18 05:18:24 +02:00

rename parameter dockerfile

This commit is contained in:
Christopher Fenner 2020-11-13 07:02:39 +01:00
parent da4cc6e5c1
commit 2a570685b8
No known key found for this signature in database
GPG Key ID: 1D72FE34B3FECE9C
4 changed files with 11 additions and 8 deletions

View File

@ -95,7 +95,7 @@ func runHadolint(config hadolintExecuteOptions, utils hadolintUtils) error {
log.Entry().Debug("No configuration file found.")
}
// execute scan command
runCommand := fmt.Sprintf("hadolint %s %s", config.DockerFile, strings.Join(options, " "))
runCommand := fmt.Sprintf("hadolint %s %s", config.Dockerfile, strings.Join(options, " "))
runCommandTokens := tokenize(runCommand)
err := utils.RunExecutable(runCommandTokens[0], runCommandTokens[1:]...)

View File

@ -17,7 +17,7 @@ type hadolintExecuteOptions struct {
ConfigurationURL string `json:"configurationUrl,omitempty"`
ConfigurationUsername string `json:"configurationUsername,omitempty"`
ConfigurationPassword string `json:"configurationPassword,omitempty"`
DockerFile string `json:"dockerFile,omitempty"`
Dockerfile string `json:"dockerfile,omitempty"`
ConfigurationFile string `json:"configurationFile,omitempty"`
ReportFile string `json:"reportFile,omitempty"`
}
@ -85,7 +85,7 @@ func addHadolintExecuteFlags(cmd *cobra.Command, stepConfig *hadolintExecuteOpti
cmd.Flags().StringVar(&stepConfig.ConfigurationURL, "configurationUrl", os.Getenv("PIPER_configurationUrl"), "URL pointing to the .hadolint.yaml exclude configuration to be used for linting. Also have a look at `configurationFile` which could avoid central configuration download in case the file is part of your repository.")
cmd.Flags().StringVar(&stepConfig.ConfigurationUsername, "configurationUsername", os.Getenv("PIPER_configurationUsername"), "The username to authenticate")
cmd.Flags().StringVar(&stepConfig.ConfigurationPassword, "configurationPassword", os.Getenv("PIPER_configurationPassword"), "The password to authenticate")
cmd.Flags().StringVar(&stepConfig.DockerFile, "dockerFile", `./Dockerfile`, "Dockerfile to be used for the assessment.")
cmd.Flags().StringVar(&stepConfig.Dockerfile, "dockerfile", `./Dockerfile`, "Dockerfile to be used for the assessment.")
cmd.Flags().StringVar(&stepConfig.ConfigurationFile, "configurationFile", `.hadolint.yaml`, "Name of the configuration file used locally within the step. If a file with this name is detected as part of your repo downloading the central configuration via `configurationUrl` will be skipped. If you change the file's name make sure your stashing configuration also reflects this.")
cmd.Flags().StringVar(&stepConfig.ReportFile, "reportFile", `hadolint.xml`, "Name of the result file used locally within the step.")
@ -138,12 +138,12 @@ func hadolintExecuteMetadata() config.StepData {
Aliases: []config.Alias{},
},
{
Name: "dockerFile",
Name: "dockerfile",
ResourceRef: []config.ResourceReference{},
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{},
Aliases: []config.Alias{{Name: "dockerFile"}},
},
{
Name: "configurationFile",

View File

@ -16,7 +16,7 @@ func TestRunHadolintExecute(t *testing.T) {
clientMock := &mocks.HadolintClient{}
runnerMock := &piperMocks.ExecMockRunner{}
config := hadolintExecuteOptions{
DockerFile: "./Dockerfile", // default
Dockerfile: "./Dockerfile", // default
ConfigurationFile: ".hadolint.yaml", // default
}
@ -49,7 +49,7 @@ func TestRunHadolintExecute(t *testing.T) {
clientMock := &mocks.HadolintClient{}
runnerMock := &piperMocks.ExecMockRunner{}
config := hadolintExecuteOptions{
DockerFile: "./Dockerfile", // default
Dockerfile: "./Dockerfile", // default
ConfigurationFile: ".hadolint.yaml", // default
ConfigurationURL: "https://myconfig",
}

View File

@ -44,7 +44,10 @@ spec:
- name: configurationCredentialsId
type: secret
param: password
- name: dockerFile
- name: dockerfile
aliases:
- name: dockerFile
deprecated: true
type: string
description: Dockerfile to be used for the assessment.
mandatory: false