Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(*): add publishing from an archive #700

Merged
merged 14 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[[constraint]]
name = "github.com/deislabs/cnab-go"
version = "v0.7.0-beta1"
version = "v0.7.1-beta1"

[[override]]
name = "github.com/deislabs/cnab-go"
version = "v0.7.0-beta1"

version = "v0.7.1-beta1"

[[constraint]]
name = "github.com/docker/cnab-to-oci"
Expand Down
6 changes: 5 additions & 1 deletion cmd/porter/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ func buildBundlePublishCommand(p *porter.Porter) *cobra.Command {
Long: "Publishes a bundle by pushing the invocation image and bundle to a registry.",
Example: ` porter bundle publish
porter bundle publish --file myapp/porter.yaml
porter bundle publish --insecure
porter bundle publish --insecure
porter bundle publish --archive /tmp/mybuns.tgz --tag myrepo/my-buns:0.1.0
`,
PreRunE: func(cmd *cobra.Command, args []string) error {
return opts.Validate(p.Context)
Expand All @@ -278,6 +279,9 @@ func buildBundlePublishCommand(p *porter.Porter) *cobra.Command {
f := cmd.Flags()
f.StringVarP(&opts.File, "file", "f", "", "Path to the Porter manifest. Defaults to `porter.yaml` in the current directory.")
f.BoolVar(&opts.InsecureRegistry, "insecure-registry", false, "Don't require TLS for the registry.")
f.StringVarP(&opts.ArchiveFile, "archive", "a", "", "Path to the bundle archive in .tgz format")
f.StringVarP(&opts.Tag, "tag", "t", "", "Bundle tag for newly published bundle; required if --archive is supplied")

return &cmd
}

Expand Down
5 changes: 4 additions & 1 deletion docs/content/cli/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ porter publish [flags]
```
porter publish
porter publish --file myapp/porter.yaml
porter publish --insecure
porter publish --insecure
porter publish --archive /tmp/mybuns.tgz --tag myrepo/my-buns:0.1.0

```

### Options

```
-a, --archive string Path to the bundle archive in .tgz format
-f, --file porter.yaml Path to the Porter manifest. Defaults to porter.yaml in the current directory.
-h, --help help for publish
--insecure-registry Don't require TLS for the registry.
-t, --tag string Bundle tag for newly published bundle; required if --archive is supplied
```

### Options inherited from parent commands
Expand Down
3 changes: 2 additions & 1 deletion pkg/cnab/cnab-to-oci/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

containerdRemotes "github.com/containerd/containerd/remotes"
"github.com/deislabs/cnab-go/bundle"
portercontext "github.com/deislabs/porter/pkg/context"
"github.com/docker/cli/cli/command"
dockerconfig "github.com/docker/cli/cli/config"
cliflags "github.com/docker/cli/cli/flags"
Expand All @@ -18,6 +17,8 @@ import (
"github.com/docker/docker/pkg/term"
"github.com/docker/docker/registry"
"github.com/pkg/errors"

portercontext "github.com/deislabs/porter/pkg/context"
)

type Registry struct {
Expand Down
Loading