-
-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish Helm chart to ghcr.io/telepresenceio
Relates to #3649 Closes #3657 Signed-off-by: Thomas Hallgren <[email protected]>
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"log" | ||
"os" | ||
|
||
"github.com/blang/semver/v4" | ||
|
||
telcharts "github.com/telepresenceio/telepresence/v2/charts" | ||
) | ||
|
||
type sv semver.Version | ||
|
||
func (v *sv) String() string { | ||
return (*semver.Version)(v).String() | ||
} | ||
|
||
func (v *sv) Set(s string) error { | ||
ver, err := semver.Parse(s) | ||
if err == nil { | ||
*v = sv(ver) | ||
} | ||
return err | ||
} | ||
|
||
func main() { | ||
var output string | ||
var version sv | ||
flag.StringVar(&output, "o", "", "output file") | ||
flag.Var(&version, "v", "Helm chart version") | ||
flag.Parse() | ||
err := packageHelmChart(output, semver.Version(version)) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} | ||
|
||
func packageHelmChart(filename string, version semver.Version) error { | ||
fh, err := os.Create(filename) | ||
if err != nil { | ||
return err | ||
} | ||
defer fh.Close() | ||
return telcharts.WriteChart(telcharts.DirTypeTelepresence, fh, "telepresence", version.String()) | ||
} |