diff --git a/cmd/werf/build/main.go b/cmd/werf/build/main.go index 1c815add5a..3887745a0f 100644 --- a/cmd/werf/build/main.go +++ b/cmd/werf/build/main.go @@ -99,10 +99,10 @@ func NewCmd(ctx context.Context) *cobra.Command { common.SetupKubeConfigBase64(&commonCmdData, cmd) common.SetupKubeContext(&commonCmdData, cmd) + common.SetupSaveBuildReport(&commonCmdData, cmd) + common.SetupBuildReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportFormat(&commonCmdData, cmd) - common.SetupBuildReportPath(&commonCmdData, cmd) - common.SetupBuildReportFormat(&commonCmdData, cmd) common.SetupAddCustomTag(&commonCmdData, cmd) common.SetupVirtualMerge(&commonCmdData, cmd) diff --git a/cmd/werf/bundle/apply/apply.go b/cmd/werf/bundle/apply/apply.go index 089bd2a3bb..db22155f41 100644 --- a/cmd/werf/bundle/apply/apply.go +++ b/cmd/werf/bundle/apply/apply.go @@ -87,6 +87,7 @@ func NewCmd(ctx context.Context) *cobra.Command { common.SetupSecretValues(&commonCmdData, cmd) common.SetupIgnoreSecretKey(&commonCmdData, cmd) + common.SetupSaveDeployReport(&commonCmdData, cmd) common.SetupDeployReportPath(&commonCmdData, cmd) common.SetupKubeConfig(&commonCmdData, cmd) @@ -219,6 +220,15 @@ func runApply(ctx context.Context) error { ChartExtender: bundle, } + var deployReportPath *string + if common.GetSaveDeployReport(&commonCmdData) { + if path, err := common.GetDeployReportPath(&commonCmdData); err != nil { + return fmt.Errorf("unable to get deploy report path: %w", err) + } else { + deployReportPath = &path + } + } + helmUpgradeCmd, _ := helm_v3.NewUpgradeCmd(actionConfig, logboek.Context(ctx).OutStream(), helm_v3.UpgradeCmdOptions{ StagesSplitter: helm.NewStagesSplitter(), StagesExternalDepsGenerator: helm.NewStagesExternalDepsGenerator(&actionConfig.RESTClientGetter, &namespace), @@ -236,7 +246,7 @@ func runApply(ctx context.Context) error { Timeout: common.NewDuration(time.Duration(cmdData.Timeout) * time.Second), IgnorePending: common.NewBool(true), CleanupOnFail: common.NewBool(true), - DeployReportPath: commonCmdData.DeployReportPath, + DeployReportPath: deployReportPath, }) return command_helpers.LockReleaseWrapper(ctx, releaseName, lockManager, func() error { diff --git a/cmd/werf/bundle/export/export.go b/cmd/werf/bundle/export/export.go index 752cca5d2e..da03144d3c 100644 --- a/cmd/werf/bundle/export/export.go +++ b/cmd/werf/bundle/export/export.go @@ -126,10 +126,10 @@ func NewCmd(ctx context.Context) *cobra.Command { commonCmdData.SetupDisableDefaultValues(cmd) commonCmdData.SetupSkipDependenciesRepoRefresh(cmd) + common.SetupSaveBuildReport(&commonCmdData, cmd) + common.SetupBuildReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportFormat(&commonCmdData, cmd) - common.SetupBuildReportPath(&commonCmdData, cmd) - common.SetupBuildReportFormat(&commonCmdData, cmd) common.SetupUseCustomTag(&commonCmdData, cmd) common.SetupVirtualMerge(&commonCmdData, cmd) diff --git a/cmd/werf/bundle/publish/publish.go b/cmd/werf/bundle/publish/publish.go index 4b7751b280..243aaba7d9 100644 --- a/cmd/werf/bundle/publish/publish.go +++ b/cmd/werf/bundle/publish/publish.go @@ -115,10 +115,10 @@ func NewCmd(ctx context.Context) *cobra.Command { commonCmdData.SetupDisableDefaultValues(cmd) commonCmdData.SetupSkipDependenciesRepoRefresh(cmd) + common.SetupSaveBuildReport(&commonCmdData, cmd) + common.SetupBuildReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportFormat(&commonCmdData, cmd) - common.SetupBuildReportPath(&commonCmdData, cmd) - common.SetupBuildReportFormat(&commonCmdData, cmd) common.SetupUseCustomTag(&commonCmdData, cmd) common.SetupAddCustomTag(&commonCmdData, cmd) diff --git a/cmd/werf/common/cmd_data.go b/cmd/werf/common/cmd_data.go index 40525f3a46..149976c07a 100644 --- a/cmd/werf/common/cmd_data.go +++ b/cmd/werf/common/cmd_data.go @@ -93,9 +93,12 @@ type CmdData struct { DeprecatedReportPath *string DeprecatedReportFormat *string - BuildReportPath *string - BuildReportFormat *string - DeployReportPath *string + + SaveBuildReport *bool + BuildReportPath *string + + SaveDeployReport *bool + DeployReportPath *string VirtualMerge *bool diff --git a/cmd/werf/common/common.go b/cmd/werf/common/common.go index 3f1afe3f8a..9929a30d59 100644 --- a/cmd/werf/common/common.go +++ b/cmd/werf/common/common.go @@ -36,6 +36,12 @@ const ( StubTag = "TAG" DefaultBuildParallelTasksLimit = 5 DefaultCleanupParallelTasksLimit = 10 + + DefaultSaveBuildReport = false + DefaultBuildReportPathJSON = ".werf-build-report.json" + + DefaultSaveDeployReport = false + DefaultDeployReportPathJSON = ".werf-deploy-report.json" ) func GetLongCommandDescription(text string) string { @@ -135,13 +141,13 @@ Defaults to $WERF_SSH_KEY_*, system ssh-agent or ~/.ssh/{id_rsa|id_dsa}, see htt func SetupDeprecatedReportPath(cmdData *CmdData, cmd *cobra.Command) { cmdData.DeprecatedReportPath = new(string) - cmd.Flags().StringVarP(cmdData.DeprecatedReportPath, "report-path", "", os.Getenv("WERF_REPORT_PATH"), "DEPRECATED: use --build-report-path.\nReport save path ($WERF_REPORT_PATH by default)") + cmd.Flags().StringVarP(cmdData.DeprecatedReportPath, "report-path", "", os.Getenv("WERF_REPORT_PATH"), "DEPRECATED: use --save-build-report with optional --build-report-path.\nReport save path ($WERF_REPORT_PATH by default)") } func SetupDeprecatedReportFormat(cmdData *CmdData, cmd *cobra.Command) { cmdData.DeprecatedReportFormat = new(string) - cmd.Flags().StringVarP(cmdData.DeprecatedReportFormat, "report-format", "", os.Getenv("WERF_REPORT_FORMAT"), fmt.Sprintf(`DEPRECATED: use --build-report-format. + cmd.Flags().StringVarP(cmdData.DeprecatedReportFormat, "report-format", "", os.Getenv("WERF_REPORT_FORMAT"), fmt.Sprintf(`DEPRECATED: use --save-build-report with optional --build-report-path. Report format: %[1]s or %[2]s (%[1]s or $WERF_REPORT_FORMAT by default) %[1]s: { "Images": { @@ -164,62 +170,104 @@ Report format: %[1]s or %[2]s (%[1]s or $WERF_REPORT_FORMAT by default) %[1]s: - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND)`, string(build.ReportJSON), string(build.ReportEnvFile))) } -func GetDeprecatedReportFormat(cmdData *CmdData) (build.ReportFormat, error) { - switch format := build.ReportFormat(*cmdData.DeprecatedReportFormat); format { +func GetDeprecatedReportPath(ctx context.Context, cmdData *CmdData) string { + if cmdData.DeprecatedReportPath == nil { + return "" + } + + logboek.Context(ctx).Warn().LogF("DEPRECATED: use --save-build-report ($WERF_SAVE_BUILD_REPORT) with optional --build-report-path ($WERF_BUILD_REPORT_PATH) instead of --report-path ($WERF_REPORT_PATH)\n") + + return *cmdData.DeprecatedReportPath +} + +func GetDeprecatedReportFormat(ctx context.Context, cmdData *CmdData) (build.ReportFormat, error) { + if cmdData.DeprecatedReportFormat == nil { + return build.ReportJSON, nil + } + + var reportFormat build.ReportFormat + switch reportFormat = build.ReportFormat(*cmdData.DeprecatedReportFormat); reportFormat { case build.ReportJSON, build.ReportEnvFile: - return format, nil case "": - return build.ReportJSON, nil + defaultFormat := build.ReportJSON + reportFormat = defaultFormat default: - return "", fmt.Errorf("bad --report-format given %q, expected: \"%s\"", format, strings.Join([]string{string(build.ReportJSON), string(build.ReportEnvFile)}, "\", \"")) + return "", fmt.Errorf("bad --report-format given %q, expected: \"%s\"", reportFormat, strings.Join([]string{string(build.ReportJSON), string(build.ReportEnvFile)}, "\", \"")) } + + logboek.Context(ctx).Warn().LogF("DEPRECATED: use --save-build-report ($WERF_SAVE_BUILD_REPORT) and optionally --build-report-path ($WERF_BUILD_REPORT_PATH) instead of --report-format ($WERF_REPORT_FORMAT)\n") + + return reportFormat, nil +} + +func SetupSaveBuildReport(cmdData *CmdData, cmd *cobra.Command) { + cmdData.SaveBuildReport = new(bool) + cmd.Flags().BoolVarP(cmdData.SaveBuildReport, "save-build-report", "", util.GetBoolEnvironmentDefaultFalse("WERF_SAVE_BUILD_REPORT"), fmt.Sprintf("Save build report (by default $WERF_SAVE_BUILD_REPORT or %t)", DefaultSaveBuildReport)) } func SetupBuildReportPath(cmdData *CmdData, cmd *cobra.Command) { cmdData.BuildReportPath = new(string) - cmd.Flags().StringVarP(cmdData.BuildReportPath, "build-report-path", "", os.Getenv("WERF_BUILD_REPORT_PATH"), "Report save path ($WERF_BUILD_REPORT_PATH by default)") + cmd.Flags().StringVarP(cmdData.BuildReportPath, "build-report-path", "", os.Getenv("WERF_BUILD_REPORT_PATH"), fmt.Sprintf("Change build report save path (by default $WERF_BUILD_REPORT_PATH or %q if not set). Extension must be either .json or .env, .json will be used if not specified", DefaultBuildReportPathJSON)) } -func SetupBuildReportFormat(cmdData *CmdData, cmd *cobra.Command) { - cmdData.BuildReportFormat = new(string) - - cmd.Flags().StringVarP(cmdData.BuildReportFormat, "build-report-format", "", os.Getenv("WERF_BUILD_REPORT_FORMAT"), fmt.Sprintf(`Report format: %[1]s or %[2]s (%[1]s or $WERF_BUILD_REPORT_FORMAT by default) -%[1]s: - { - "Images": { - "": { - "WerfImageName": "", - "DockerRepo": "", - "DockerTag": "" - "DockerImageName": ":", - "DockerImageID": "", - "DockerImageDigest": "", - }, - ... - } +func GetSaveBuildReport(cmdData *CmdData) bool { + if cmdData.SaveBuildReport == nil { + return false } -%[2]s: - WERF__DOCKER_IMAGE_NAME=: - ... - is werf image name from werf.yaml modified according to the following rules: -- all characters are uppercase (app -> APP); -- charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND)`, string(build.ReportJSON), string(build.ReportEnvFile))) + + return *cmdData.SaveBuildReport } -func GetBuildReportFormat(cmdData *CmdData) (build.ReportFormat, error) { - switch format := build.ReportFormat(*cmdData.BuildReportFormat); format { - case build.ReportJSON, build.ReportEnvFile: - return format, nil +func GetBuildReportPathAndFormat(cmdData *CmdData) (string, build.ReportFormat, error) { + unspecifiedPath := cmdData.BuildReportPath == nil || *cmdData.BuildReportPath == "" + if unspecifiedPath { + return DefaultBuildReportPathJSON, build.ReportJSON, nil + } + + switch ext := filepath.Ext(*cmdData.BuildReportPath); ext { + case ".json": + return *cmdData.BuildReportPath, build.ReportJSON, nil + case ".env": + return *cmdData.BuildReportPath, build.ReportEnvFile, nil case "": - return build.ReportJSON, nil + return *cmdData.BuildReportPath + ".json", build.ReportJSON, nil default: - return "", fmt.Errorf("bad --build-report-format given %q, expected: \"%s\"", format, strings.Join([]string{string(build.ReportJSON), string(build.ReportEnvFile)}, "\", \"")) + return "", "", fmt.Errorf("invalid --build-report-path %q: extension must be either .json or .env or unspecified", *cmdData.BuildReportPath) } } +func SetupSaveDeployReport(cmdData *CmdData, cmd *cobra.Command) { + cmdData.SaveDeployReport = new(bool) + cmd.Flags().BoolVarP(cmdData.SaveDeployReport, "save-deploy-report", "", util.GetBoolEnvironmentDefaultFalse("WERF_SAVE_DEPLOY_REPORT"), fmt.Sprintf("Save deploy report (by default $WERF_SAVE_DEPLOY_REPORT or %t)", DefaultSaveDeployReport)) +} + func SetupDeployReportPath(cmdData *CmdData, cmd *cobra.Command) { cmdData.DeployReportPath = new(string) - cmd.Flags().StringVarP(cmdData.DeployReportPath, "deploy-report-path", "", os.Getenv("WERF_DEPLOY_REPORT_PATH"), "Deploy report save path ($WERF_DEPLOY_REPORT_PATH by default)") + cmd.Flags().StringVarP(cmdData.DeployReportPath, "deploy-report-path", "", os.Getenv("WERF_DEPLOY_REPORT_PATH"), fmt.Sprintf("Change deploy report save path (by default $WERF_DEPLOY_REPORT_PATH or %q if not set). Extension must be either .json or unspecified", DefaultDeployReportPathJSON)) +} + +func GetSaveDeployReport(cmdData *CmdData) bool { + if cmdData.SaveDeployReport == nil { + return false + } + + return *cmdData.SaveDeployReport +} + +func GetDeployReportPath(cmdData *CmdData) (string, error) { + unspecifiedPath := cmdData.DeployReportPath == nil || *cmdData.DeployReportPath == "" + if unspecifiedPath { + return DefaultDeployReportPathJSON, nil + } + + switch ext := filepath.Ext(*cmdData.DeployReportPath); ext { + case ".json": + return *cmdData.DeployReportPath, nil + case "": + return *cmdData.DeployReportPath + ".json", nil + default: + return "", fmt.Errorf("invalid --deploy-report-path %q: extension must be either .json or unspecified", *cmdData.DeployReportPath) + } } func SetupWithoutKube(cmdData *CmdData, cmd *cobra.Command) { diff --git a/cmd/werf/common/conveyor_options.go b/cmd/werf/common/conveyor_options.go index 8e83a6bf3f..c6f49838fd 100644 --- a/cmd/werf/common/conveyor_options.go +++ b/cmd/werf/common/conveyor_options.go @@ -7,7 +7,6 @@ import ( "strings" "text/template" - "github.com/werf/logboek" "github.com/werf/werf/pkg/build" "github.com/werf/werf/pkg/build/stage" "github.com/werf/werf/pkg/config" @@ -57,34 +56,6 @@ func GetBuildOptions(ctx context.Context, commonCmdData *CmdData, giterminismMan return buildOptions, err } - var buildReportPath string - if commonCmdData.BuildReportPath != nil && *commonCmdData.BuildReportPath != "" && commonCmdData.DeprecatedReportPath != nil && *commonCmdData.DeprecatedReportPath != "" { - return buildOptions, fmt.Errorf("you can't use both --report-path ($WERF_REPORT_PATH) and --build-report-path ($WERF_BUILD_REPORT_PATH), use only the latter instead") - } else if commonCmdData.BuildReportPath != nil && *commonCmdData.BuildReportPath != "" { - buildReportPath = *commonCmdData.BuildReportPath - } else if commonCmdData.DeprecatedReportPath != nil && *commonCmdData.DeprecatedReportPath != "" { - logboek.Context(ctx).Warn().LogF("DEPRECATED: use --build-report-path ($WERF_BUILD_REPORT_PATH) instead of --report-path ($WERF_REPORT_PATH)\n") - buildReportPath = *commonCmdData.DeprecatedReportPath - } - - var buildReportFormat build.ReportFormat - if commonCmdData.BuildReportFormat != nil && *commonCmdData.BuildReportFormat != "" && commonCmdData.DeprecatedReportFormat != nil && *commonCmdData.DeprecatedReportFormat != "" { - return buildOptions, fmt.Errorf("you can't use both --report-format ($WERF_REPORT_FORMAT) and --build-report-format ($WERF_BUILD_REPORT_FORMAT), use only the latter instead") - } else if commonCmdData.BuildReportFormat != nil && *commonCmdData.BuildReportFormat != "" { - buildReportFormat, err = GetBuildReportFormat(commonCmdData) - if err != nil { - return buildOptions, fmt.Errorf("error getting build report format: %w", err) - } - } else if commonCmdData.DeprecatedReportFormat != nil && *commonCmdData.DeprecatedReportFormat != "" { - logboek.Context(ctx).Warn().LogF("DEPRECATED: use --build-report-format ($WERF_BUILD_REPORT_FORMAT) instead of --report-format ($WERF_REPORT_FORMAT)\n") - buildReportFormat, err = GetDeprecatedReportFormat(commonCmdData) - if err != nil { - return buildOptions, fmt.Errorf("error getting report format: %w", err) - } - } else { - buildReportFormat = build.ReportJSON - } - customTagFuncList, err := getCustomTagFuncList(getCustomTagOptionValues(commonCmdData), commonCmdData, giterminismManager, werfConfig) if err != nil { return buildOptions, err @@ -98,8 +69,28 @@ func GetBuildOptions(ctx context.Context, commonCmdData *CmdData, giterminismMan IntrospectBeforeError: *commonCmdData.IntrospectBeforeError, }, IntrospectOptions: introspectOptions, - ReportPath: buildReportPath, - ReportFormat: buildReportFormat, + } + + usedNewBuildReportOption := (commonCmdData.SaveBuildReport != nil && *commonCmdData.SaveBuildReport == true) || (commonCmdData.BuildReportPath != nil && *commonCmdData.BuildReportPath != "") + + usedOldBuildReportOption := (commonCmdData.DeprecatedReportPath != nil && *commonCmdData.DeprecatedReportPath != "") || (commonCmdData.DeprecatedReportFormat != nil && *commonCmdData.DeprecatedReportFormat != "") + + if usedNewBuildReportOption && usedOldBuildReportOption { + return buildOptions, fmt.Errorf("you can't use deprecated options --report-path and --report-format along with new options --save-build-report, --build-report-path, use only the latter instead") + } + + if usedNewBuildReportOption && GetSaveBuildReport(commonCmdData) { + buildOptions.ReportPath, buildOptions.ReportFormat, err = GetBuildReportPathAndFormat(commonCmdData) + if err != nil { + return buildOptions, fmt.Errorf("getting build report path failed: %w", err) + } + } else if usedOldBuildReportOption { + buildOptions.ReportFormat, err = GetDeprecatedReportFormat(ctx, commonCmdData) + if err != nil { + return buildOptions, fmt.Errorf("getting deprecated build report format failed: %w", err) + } + + buildOptions.ReportPath = GetDeprecatedReportPath(ctx, commonCmdData) } return buildOptions, nil diff --git a/cmd/werf/converge/converge.go b/cmd/werf/converge/converge.go index a392bf0aab..1093194df9 100644 --- a/cmd/werf/converge/converge.go +++ b/cmd/werf/converge/converge.go @@ -159,10 +159,12 @@ werf converge --repo registry.mydomain.com/web --env production`, commonCmdData.SetupDisableDefaultSecretValues(cmd) commonCmdData.SetupSkipDependenciesRepoRefresh(cmd) + common.SetupSaveBuildReport(&commonCmdData, cmd) + common.SetupBuildReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportFormat(&commonCmdData, cmd) - common.SetupBuildReportPath(&commonCmdData, cmd) - common.SetupBuildReportFormat(&commonCmdData, cmd) + + common.SetupSaveDeployReport(&commonCmdData, cmd) common.SetupDeployReportPath(&commonCmdData, cmd) common.SetupUseCustomTag(&commonCmdData, cmd) @@ -474,6 +476,15 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken return err } + var deployReportPath *string + if common.GetSaveDeployReport(&commonCmdData) { + if path, err := common.GetDeployReportPath(&commonCmdData); err != nil { + return fmt.Errorf("unable to get deploy report path: %w", err) + } else { + deployReportPath = &path + } + } + helmUpgradeCmd, _ := helm_v3.NewUpgradeCmd(actionConfig, logboek.OutStream(), helm_v3.UpgradeCmdOptions{ StagesSplitter: helm.NewStagesSplitter(), StagesExternalDepsGenerator: helm.NewStagesExternalDepsGenerator(&actionConfig.RESTClientGetter, &namespace), @@ -486,7 +497,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken Timeout: common.NewDuration(time.Duration(cmdData.Timeout) * time.Second), IgnorePending: common.NewBool(true), CleanupOnFail: common.NewBool(true), - DeployReportPath: commonCmdData.DeployReportPath, + DeployReportPath: deployReportPath, }) return command_helpers.LockReleaseWrapper(ctx, releaseName, lockManager, func() error { diff --git a/cmd/werf/render/render.go b/cmd/werf/render/render.go index dd0bc85511..9d02c17436 100644 --- a/cmd/werf/render/render.go +++ b/cmd/werf/render/render.go @@ -137,10 +137,10 @@ func NewCmd(ctx context.Context) *cobra.Command { commonCmdData.SetupDisableDefaultSecretValues(cmd) commonCmdData.SetupSkipDependenciesRepoRefresh(cmd) + common.SetupSaveBuildReport(&commonCmdData, cmd) + common.SetupBuildReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportPath(&commonCmdData, cmd) common.SetupDeprecatedReportFormat(&commonCmdData, cmd) - common.SetupBuildReportPath(&commonCmdData, cmd) - common.SetupBuildReportFormat(&commonCmdData, cmd) common.SetupUseCustomTag(&commonCmdData, cmd) common.SetupVirtualMerge(&commonCmdData, cmd) diff --git a/docs/_includes/reference/cli/werf_build.md b/docs/_includes/reference/cli/werf_build.md index 5e89d71953..e0263bfec6 100644 --- a/docs/_includes/reference/cli/werf_build.md +++ b/docs/_includes/reference/cli/werf_build.md @@ -67,31 +67,10 @@ werf build [IMAGE_NAME...] [options] until volume usage becomes below "allowed-docker-storage-volume-usage - allowed-docker-storage-volume-usage-margin" level (default 5% or $WERF_ALLOWED_LOCAL_CACHE_VOLUME_USAGE_MARGIN) - --build-report-format='' - Report format: json or envfile (json or $WERF_BUILD_REPORT_FORMAT by default) - json: - { - "Images": { - "": { - "WerfImageName": "", - "DockerRepo": "", - "DockerTag": "" - "DockerImageName": ":", - "DockerImageID": "", - "DockerImageDigest": "", - }, - ... - } - } - envfile: - WERF__DOCKER_IMAGE_NAME=: - ... - is werf image name from werf.yaml modified according to the - following rules: - - all characters are uppercase (app -> APP); - - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --build-report-path='' - Report save path ($WERF_BUILD_REPORT_PATH by default) + Change build report save path (by default $WERF_BUILD_REPORT_PATH or + ".werf-build-report.json" if not set). Extension must be either .json or .env, .json + will be used if not specified --cache-repo=[] Specify one or multiple cache repos with images that will be used as a cache. Cache will be populated when pushing newly built images into the primary repo and when @@ -274,7 +253,7 @@ werf build [IMAGE_NAME...] [options] --repo-selectel-vpc-id='' repo Selectel VPC ID (default $WERF_REPO_SELECTEL_VPC_ID) --report-format='' - DEPRECATED: use --build-report-format. + DEPRECATED: use --save-build-report with optional --build-report-path. Report format: json or envfile (json or $WERF_REPORT_FORMAT by default) json: { "Images": { @@ -297,8 +276,10 @@ werf build [IMAGE_NAME...] [options] - all characters are uppercase (app -> APP); - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --report-path='' - DEPRECATED: use --build-report-path. + DEPRECATED: use --save-build-report with optional --build-report-path. Report save path ($WERF_REPORT_PATH by default) + --save-build-report=false + Save build report (by default $WERF_SAVE_BUILD_REPORT or %!q(bool=false)) --secondary-repo=[] Specify one or multiple secondary read-only repos with images that will be used as a cache. diff --git a/docs/_includes/reference/cli/werf_bundle_apply.md b/docs/_includes/reference/cli/werf_bundle_apply.md index 30362726bf..0673a8270c 100644 --- a/docs/_includes/reference/cli/werf_bundle_apply.md +++ b/docs/_includes/reference/cli/werf_bundle_apply.md @@ -27,7 +27,8 @@ werf bundle apply [options] Also, can be specified with $WERF_ADD_LABEL_* (e.g. $WERF_ADD_LABEL_1=labelName1=labelValue1, $WERF_ADD_LABEL_2=labelName2=labelValue2) --deploy-report-path='' - Deploy report save path ($WERF_DEPLOY_REPORT_PATH by default) + Change deploy report save path (by default $WERF_DEPLOY_REPORT_PATH or + ".werf-deploy-report.json" if not set). Extension must be either .json or unspecified --docker-config='' Specify docker config directory path. Default $WERF_DOCKER_CONFIG or $DOCKER_CONFIG or ~/.docker (in the order of priority) @@ -116,6 +117,8 @@ werf bundle apply [options] repo Selectel VPC (default $WERF_REPO_SELECTEL_VPC) --repo-selectel-vpc-id='' repo Selectel VPC ID (default $WERF_REPO_SELECTEL_VPC_ID) + --save-deploy-report=false + Save deploy report (by default $WERF_SAVE_DEPLOY_REPORT or %!q(bool=false)) --secret-values=[] Specify helm secret values in a YAML file (can specify multiple). Also, can be defined with $WERF_SECRET_VALUES_* (e.g. diff --git a/docs/_includes/reference/cli/werf_bundle_export.md b/docs/_includes/reference/cli/werf_bundle_export.md index d8da565b5b..58b7e5c437 100644 --- a/docs/_includes/reference/cli/werf_bundle_export.md +++ b/docs/_includes/reference/cli/werf_bundle_export.md @@ -43,31 +43,10 @@ werf bundle export [IMAGE_NAME...] [options] until volume usage becomes below "allowed-docker-storage-volume-usage - allowed-docker-storage-volume-usage-margin" level (default 5% or $WERF_ALLOWED_LOCAL_CACHE_VOLUME_USAGE_MARGIN) - --build-report-format='' - Report format: json or envfile (json or $WERF_BUILD_REPORT_FORMAT by default) - json: - { - "Images": { - "": { - "WerfImageName": "", - "DockerRepo": "", - "DockerTag": "" - "DockerImageName": ":", - "DockerImageID": "", - "DockerImageDigest": "", - }, - ... - } - } - envfile: - WERF__DOCKER_IMAGE_NAME=: - ... - is werf image name from werf.yaml modified according to the - following rules: - - all characters are uppercase (app -> APP); - - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --build-report-path='' - Report save path ($WERF_BUILD_REPORT_PATH by default) + Change build report save path (by default $WERF_BUILD_REPORT_PATH or + ".werf-build-report.json" if not set). Extension must be either .json or .env, .json + will be used if not specified --cache-repo=[] Specify one or multiple cache repos with images that will be used as a cache. Cache will be populated when pushing newly built images into the primary repo and when @@ -242,7 +221,7 @@ werf bundle export [IMAGE_NAME...] [options] --repo-selectel-vpc-id='' repo Selectel VPC ID (default $WERF_REPO_SELECTEL_VPC_ID) --report-format='' - DEPRECATED: use --build-report-format. + DEPRECATED: use --save-build-report with optional --build-report-path. Report format: json or envfile (json or $WERF_REPORT_FORMAT by default) json: { "Images": { @@ -265,8 +244,10 @@ werf bundle export [IMAGE_NAME...] [options] - all characters are uppercase (app -> APP); - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --report-path='' - DEPRECATED: use --build-report-path. + DEPRECATED: use --save-build-report with optional --build-report-path. Report save path ($WERF_REPORT_PATH by default) + --save-build-report=false + Save build report (by default $WERF_SAVE_BUILD_REPORT or %!q(bool=false)) --secondary-repo=[] Specify one or multiple secondary read-only repos with images that will be used as a cache. diff --git a/docs/_includes/reference/cli/werf_bundle_publish.md b/docs/_includes/reference/cli/werf_bundle_publish.md index ab6388100f..28db252863 100644 --- a/docs/_includes/reference/cli/werf_bundle_publish.md +++ b/docs/_includes/reference/cli/werf_bundle_publish.md @@ -54,31 +54,10 @@ werf bundle publish [IMAGE_NAME...] [options] until volume usage becomes below "allowed-docker-storage-volume-usage - allowed-docker-storage-volume-usage-margin" level (default 5% or $WERF_ALLOWED_LOCAL_CACHE_VOLUME_USAGE_MARGIN) - --build-report-format='' - Report format: json or envfile (json or $WERF_BUILD_REPORT_FORMAT by default) - json: - { - "Images": { - "": { - "WerfImageName": "", - "DockerRepo": "", - "DockerTag": "" - "DockerImageName": ":", - "DockerImageID": "", - "DockerImageDigest": "", - }, - ... - } - } - envfile: - WERF__DOCKER_IMAGE_NAME=: - ... - is werf image name from werf.yaml modified according to the - following rules: - - all characters are uppercase (app -> APP); - - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --build-report-path='' - Report save path ($WERF_BUILD_REPORT_PATH by default) + Change build report save path (by default $WERF_BUILD_REPORT_PATH or + ".werf-build-report.json" if not set). Extension must be either .json or .env, .json + will be used if not specified --cache-repo=[] Specify one or multiple cache repos with images that will be used as a cache. Cache will be populated when pushing newly built images into the primary repo and when @@ -269,7 +248,7 @@ werf bundle publish [IMAGE_NAME...] [options] --repo-selectel-vpc-id='' repo Selectel VPC ID (default $WERF_REPO_SELECTEL_VPC_ID) --report-format='' - DEPRECATED: use --build-report-format. + DEPRECATED: use --save-build-report with optional --build-report-path. Report format: json or envfile (json or $WERF_REPORT_FORMAT by default) json: { "Images": { @@ -292,8 +271,10 @@ werf bundle publish [IMAGE_NAME...] [options] - all characters are uppercase (app -> APP); - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --report-path='' - DEPRECATED: use --build-report-path. + DEPRECATED: use --save-build-report with optional --build-report-path. Report save path ($WERF_REPORT_PATH by default) + --save-build-report=false + Save build report (by default $WERF_SAVE_BUILD_REPORT or %!q(bool=false)) --secondary-repo=[] Specify one or multiple secondary read-only repos with images that will be used as a cache. diff --git a/docs/_includes/reference/cli/werf_converge.md b/docs/_includes/reference/cli/werf_converge.md index af18c47ca2..6a4d7f5c0f 100644 --- a/docs/_includes/reference/cli/werf_converge.md +++ b/docs/_includes/reference/cli/werf_converge.md @@ -84,31 +84,10 @@ werf converge --repo registry.mydomain.com/web --env production -R, --auto-rollback=false Enable auto rollback of the failed release to the previous deployed release version when current deploy process have failed ($WERF_AUTO_ROLLBACK by default) - --build-report-format='' - Report format: json or envfile (json or $WERF_BUILD_REPORT_FORMAT by default) - json: - { - "Images": { - "": { - "WerfImageName": "", - "DockerRepo": "", - "DockerTag": "" - "DockerImageName": ":", - "DockerImageID": "", - "DockerImageDigest": "", - }, - ... - } - } - envfile: - WERF__DOCKER_IMAGE_NAME=: - ... - is werf image name from werf.yaml modified according to the - following rules: - - all characters are uppercase (app -> APP); - - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --build-report-path='' - Report save path ($WERF_BUILD_REPORT_PATH by default) + Change build report save path (by default $WERF_BUILD_REPORT_PATH or + ".werf-build-report.json" if not set). Extension must be either .json or .env, .json + will be used if not specified --cache-repo=[] Specify one or multiple cache repos with images that will be used as a cache. Cache will be populated when pushing newly built images into the primary repo and when @@ -122,7 +101,8 @@ werf converge --repo registry.mydomain.com/web --env production Custom configuration templates directory (default $WERF_CONFIG_TEMPLATES_DIR or .werf in working directory) --deploy-report-path='' - Deploy report save path ($WERF_DEPLOY_REPORT_PATH by default) + Change deploy report save path (by default $WERF_DEPLOY_REPORT_PATH or + ".werf-deploy-report.json" if not set). Extension must be either .json or unspecified --dev=false Enable development mode (default $WERF_DEV). The mode allows working with project files without doing redundant commits during @@ -312,7 +292,7 @@ werf converge --repo registry.mydomain.com/web --env production --repo-selectel-vpc-id='' repo Selectel VPC ID (default $WERF_REPO_SELECTEL_VPC_ID) --report-format='' - DEPRECATED: use --build-report-format. + DEPRECATED: use --save-build-report with optional --build-report-path. Report format: json or envfile (json or $WERF_REPORT_FORMAT by default) json: { "Images": { @@ -335,8 +315,12 @@ werf converge --repo registry.mydomain.com/web --env production - all characters are uppercase (app -> APP); - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --report-path='' - DEPRECATED: use --build-report-path. + DEPRECATED: use --save-build-report with optional --build-report-path. Report save path ($WERF_REPORT_PATH by default) + --save-build-report=false + Save build report (by default $WERF_SAVE_BUILD_REPORT or %!q(bool=false)) + --save-deploy-report=false + Save deploy report (by default $WERF_SAVE_DEPLOY_REPORT or %!q(bool=false)) --secondary-repo=[] Specify one or multiple secondary read-only repos with images that will be used as a cache. diff --git a/docs/_includes/reference/cli/werf_render.md b/docs/_includes/reference/cli/werf_render.md index 28f9c857b4..da890df7c4 100644 --- a/docs/_includes/reference/cli/werf_render.md +++ b/docs/_includes/reference/cli/werf_render.md @@ -37,31 +37,10 @@ werf render [IMAGE_NAME...] [options] Format: labelName=labelValue. Also, can be specified with $WERF_ADD_LABEL_* (e.g. $WERF_ADD_LABEL_1=labelName1=labelValue1, $WERF_ADD_LABEL_2=labelName2=labelValue2) - --build-report-format='' - Report format: json or envfile (json or $WERF_BUILD_REPORT_FORMAT by default) - json: - { - "Images": { - "": { - "WerfImageName": "", - "DockerRepo": "", - "DockerTag": "" - "DockerImageName": ":", - "DockerImageID": "", - "DockerImageDigest": "", - }, - ... - } - } - envfile: - WERF__DOCKER_IMAGE_NAME=: - ... - is werf image name from werf.yaml modified according to the - following rules: - - all characters are uppercase (app -> APP); - - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --build-report-path='' - Report save path ($WERF_BUILD_REPORT_PATH by default) + Change build report save path (by default $WERF_BUILD_REPORT_PATH or + ".werf-build-report.json" if not set). Extension must be either .json or .env, .json + will be used if not specified --cache-repo=[] Specify one or multiple cache repos with images that will be used as a cache. Cache will be populated when pushing newly built images into the primary repo and when @@ -256,7 +235,7 @@ werf render [IMAGE_NAME...] [options] --repo-selectel-vpc-id='' repo Selectel VPC ID (default $WERF_REPO_SELECTEL_VPC_ID) --report-format='' - DEPRECATED: use --build-report-format. + DEPRECATED: use --save-build-report with optional --build-report-path. Report format: json or envfile (json or $WERF_REPORT_FORMAT by default) json: { "Images": { @@ -279,8 +258,10 @@ werf render [IMAGE_NAME...] [options] - all characters are uppercase (app -> APP); - charset /- is replaced with _ (DEV/APP-FRONTEND -> DEV_APP_FRONTEND) --report-path='' - DEPRECATED: use --build-report-path. + DEPRECATED: use --save-build-report with optional --build-report-path. Report save path ($WERF_REPORT_PATH by default) + --save-build-report=false + Save build report (by default $WERF_SAVE_BUILD_REPORT or %!q(bool=false)) --secondary-repo=[] Specify one or multiple secondary read-only repos with images that will be used as a cache.