-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish each version only once on gcom publish (#192)
- Loading branch information
1 parent
142d2dc
commit b8af7b5
Showing
4 changed files
with
83 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
package containers | ||
|
||
import "github.com/grafana/grafana-build/cliutil" | ||
import ( | ||
"net/url" | ||
|
||
"github.com/grafana/grafana-build/cliutil" | ||
) | ||
|
||
// GCOMOpts are options used when making requests to grafana.com. | ||
type GCOMOpts struct { | ||
URL string | ||
URL *url.URL | ||
DownloadURL *url.URL | ||
ApiKey string | ||
DownloadURL string | ||
} | ||
|
||
func GCOMOptsFromFlags(c cliutil.CLIContext) *GCOMOpts { | ||
func GCOMOptsFromFlags(c cliutil.CLIContext) (*GCOMOpts, error) { | ||
apiUrl, err := url.Parse(c.String("url")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
downloadUrl, err := url.Parse(c.String("download-url")) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &GCOMOpts{ | ||
URL: c.String("url"), | ||
URL: apiUrl, | ||
DownloadURL: downloadUrl, | ||
ApiKey: c.String("api-key"), | ||
DownloadURL: c.String("download-url"), | ||
} | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters