Skip to content

Commit

Permalink
update deploy artifact flag and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maorfr committed Nov 8, 2018
1 parent 031a62d commit b6021c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ Also using Orca? Let us know by opening an issue or a PR to this section!

## Install

### From a release
### Prerequisites

1. git
2. [dep](https://github.com/golang/dep)
3. [Helm](https://helm.sh/) (required for `env` and `chart` subcommands)
4. [ChartMuseum](https://github.com/helm/charts/tree/master/stable/chartmuseum) or any other chart repository implementation (required for `deploy` commands)

### From a release

Download the latest release from the [Releases page](https://github.com/maorfr/orca/releases) or use it in your CI\CD process with a [Docker image](https://hub.docker.com/r/maorfr/orca)

### From source
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Usage:
orca deploy artifact [flags]
Flags:
--artifact string path to artifact to deploy. Overrides $ORCA_ARTIFACT
--file string path to file to deploy. Overrides $ORCA_FILE
--token string token to use for deployment. Overrides $ORCA_TOKEN
--url string url to deploy to. Overrides $ORCA_URL
```
Expand Down
14 changes: 7 additions & 7 deletions pkg/orca/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
)

type artifactCmd struct {
url string
token string
artifact string
url string
token string
file string

out io.Writer
}
Expand All @@ -34,16 +34,16 @@ func NewDeployArtifactCmd(out io.Writer) *cobra.Command {
if a.token == "" {
return errors.New("token to use for deployment has to be defined")
}
if a.artifact == "" {
if a.file == "" {
return errors.New("artifact to deploy has to be defined")
}
if _, err := os.Stat(a.artifact); err != nil {
if _, err := os.Stat(a.file); err != nil {
return errors.New("artifact to deploy does not exist")
}
return nil
},
Run: func(cmd *cobra.Command, args []string) {
data, err := os.Open(a.artifact)
data, err := os.Open(a.file)
if err != nil {
log.Fatal(err)
}
Expand All @@ -61,7 +61,7 @@ func NewDeployArtifactCmd(out io.Writer) *cobra.Command {

f.StringVar(&a.url, "url", os.Getenv("ORCA_URL"), "url to deploy to. Overrides $ORCA_URL")
f.StringVar(&a.token, "token", os.Getenv("ORCA_TOKEN"), "token to use for deployment. Overrides $ORCA_TOKEN")
f.StringVar(&a.artifact, "artifact", os.Getenv("ORCA_FILE"), "path to artifact to deploy. Overrides $ORCA_ARTIFACT")
f.StringVar(&a.file, "file", os.Getenv("ORCA_FILE"), "path to artifact to deploy. Overrides $ORCA_FILE")

return cmd
}

0 comments on commit b6021c9

Please sign in to comment.