Skip to content

Commit

Permalink
fix(bundles): deprecate bundle export/download commands in favor of n…
Browse files Browse the repository at this point in the history
…ew copy command abilities

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Sep 6, 2022
1 parent e51546c commit d49a81f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cmd/werf/bundle/download/download.go
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/spf13/cobra"
helm_v3 "helm.sh/helm/v3/cmd/helm"

"github.com/werf/logboek"
"github.com/werf/werf/cmd/werf/common"
"github.com/werf/werf/pkg/deploy/bundles"
"github.com/werf/werf/pkg/werf"
Expand All @@ -26,6 +27,7 @@ func NewCmd(ctx context.Context) *cobra.Command {
cmd := common.SetCommandContext(ctx, &cobra.Command{
Use: "download",
Short: "Download published bundle into directory",
Hidden: true, // Deprecated command
Long: common.GetLongCommandDescription(`Take latest bundle from the specified container registry using specified version tag or version mask and unpack it into provided directory (or into directory named as a resulting chart in the current working directory).`),
DisableFlagsInUseLine: true,
Annotations: map[string]string{
Expand All @@ -34,6 +36,21 @@ func NewCmd(ctx context.Context) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()

logboek.Context(ctx).Warn().LogF("WARNING: werf bundle download is DEPRECATED!\n")
logboek.Context(ctx).Warn().LogF("WARNING: To download published bundle from the registry and unpack bundle helm chart into directory use following commands:\n")
logboek.Context(ctx).Warn().LogF("WARNING: \n")
logboek.Context(ctx).Warn().LogF("WARNING: 1. Publish bundle into some registry:\n")
logboek.Context(ctx).Warn().LogF("WARNING: werf bundle publish --repo REPO --tag TAG\n")
logboek.Context(ctx).Warn().LogF("WARNING: \n")
logboek.Context(ctx).Warn().LogF("WARNING: 2. Copy published bundle from the registry to bundle archive:\n")
logboek.Context(ctx).Warn().LogF("WARNING: werf bundle copy --from REPO:TAG --to archive:PATH_TO_ARCHIVE.tar.gz\n")
logboek.Context(ctx).Warn().LogF("WARNING: \n")
logboek.Context(ctx).Warn().LogF("WARNING: 3. Unpack bundle archive:\n")
logboek.Context(ctx).Warn().LogF("WARNING: tar xf PATH_TO_ARCHIVE.tar.gz\n")
logboek.Context(ctx).Warn().LogF("WARNING: \n")
logboek.Context(ctx).Warn().LogF("WARNING: 4. Unpack chart archive inside unpacked bundle archive directory:\n")
logboek.Context(ctx).Warn().LogF("WARNING: tar xf chart.tar.gz\n")

defer global_warnings.PrintGlobalWarnings(ctx)

if err := common.ProcessLogOptions(&commonCmdData); err != nil {
Expand Down
16 changes: 16 additions & 0 deletions cmd/werf/bundle/export/export.go
Expand Up @@ -42,6 +42,7 @@ func NewCmd(ctx context.Context) *cobra.Command {
cmd := common.SetCommandContext(ctx, &cobra.Command{
Use: "export",
Short: "Export bundle",
Hidden: true, // Deprecated command
Long: common.GetLongCommandDescription(`Export bundle into the provided directory (or into directory named as a resulting chart in the current working directory). werf bundle contains built images defined in the werf.yaml, helm chart, service values which contain built images tags, any custom values and set values params provided during publish invocation, werf service templates and values.`),
DisableFlagsInUseLine: true,
Annotations: map[string]string{
Expand All @@ -50,6 +51,21 @@ func NewCmd(ctx context.Context) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()

logboek.Context(ctx).Warn().LogF("WARNING: werf bundle export is DEPRECATED!\n")
logboek.Context(ctx).Warn().LogF("WARNING: To create bundle helm chart directory from your git werf project use following commands:\n")
logboek.Context(ctx).Warn().LogF("WARNING: \n")
logboek.Context(ctx).Warn().LogF("WARNING: 1. Publish bundle into some registry:\n")
logboek.Context(ctx).Warn().LogF("WARNING: werf bundle publish --repo REPO --tag TAG\n")
logboek.Context(ctx).Warn().LogF("WARNING: \n")
logboek.Context(ctx).Warn().LogF("WARNING: 2. Copy published bundle from the registry to bundle archive:\n")
logboek.Context(ctx).Warn().LogF("WARNING: werf bundle copy --from REPO:TAG --to archive:PATH_TO_ARCHIVE.tar.gz\n")
logboek.Context(ctx).Warn().LogF("WARNING: \n")
logboek.Context(ctx).Warn().LogF("WARNING: 3. Unpack bundle archive:\n")
logboek.Context(ctx).Warn().LogF("WARNING: tar xf PATH_TO_ARCHIVE.tar.gz\n")
logboek.Context(ctx).Warn().LogF("WARNING: \n")
logboek.Context(ctx).Warn().LogF("WARNING: 4. Unpack chart archive inside unpacked bundle archive directory:\n")
logboek.Context(ctx).Warn().LogF("WARNING: tar xf chart.tar.gz\n")

defer global_warnings.PrintGlobalWarnings(ctx)

if err := common.ProcessLogOptions(&commonCmdData); err != nil {
Expand Down

0 comments on commit d49a81f

Please sign in to comment.