diff --git a/cmd/containerd-release/build.go b/cmd/containerd-release/build.go index 1c7297458..94a32f96e 100644 --- a/cmd/containerd-release/build.go +++ b/cmd/containerd-release/build.go @@ -8,6 +8,7 @@ import ( "os" "os/exec" "runtime" + "strings" ) func build() error { @@ -18,10 +19,10 @@ func build() error { return nil } -const tarFormat = "containerd-%s.%s-%s.tar.gz" +const tarFormat = "%s-%s.%s-%s.tar.gz" -func tarRelease(tag string) (string, error) { - path := fmt.Sprintf(tarFormat, tag, runtime.GOOS, runtime.GOARCH) +func tarRelease(projectName, tag string) (string, error) { + path := fmt.Sprintf(tarFormat, strings.ToLower(projectName), tag, runtime.GOOS, runtime.GOARCH) out, err := exec.Command("tar", "-zcf", path, "bin/").CombinedOutput() if err != nil { return "", fmt.Errorf("%s: %s", err, out) diff --git a/cmd/containerd-release/main.go b/cmd/containerd-release/main.go index 459c22633..01dc19895 100644 --- a/cmd/containerd-release/main.go +++ b/cmd/containerd-release/main.go @@ -33,6 +33,8 @@ type download struct { } type release struct { + ProjectName string `toml:"project_name"` + GithubRepo string `toml:"github_repo"` Commit string `toml:"commit"` Previous string `toml:"previous"` PreRelease bool `toml:"pre_release"` @@ -49,10 +51,10 @@ type release struct { func main() { app := cli.NewApp() - app.Name = "containerd-release" - app.Description = `release tooling for containerd. + app.Name = "release" + app.Description = `release tooling. -This tool should be ran from the root of the containerd repository for a new release. +This tool should be ran from the root of the project repository for a new release. ` app.Flags = []cli.Flag{ cli.BoolFlag{ @@ -61,7 +63,6 @@ This tool should be ran from the root of the containerd repository for a new rel }, } app.Action = func(context *cli.Context) error { - logrus.Info("Welcome to the containerd release tool...") var ( path = context.Args().First() tag = parseTag(path) @@ -70,6 +71,7 @@ This tool should be ran from the root of the containerd repository for a new rel if err != nil { return err } + logrus.Info("Welcome to the %s release tool...", r.ProjectName) previous, err := getPreviousDeps(r.Previous) if err != nil { return err diff --git a/cmd/containerd-release/template.go b/cmd/containerd-release/template.go index bb2f0a7d3..9e347e763 100644 --- a/cmd/containerd-release/template.go +++ b/cmd/containerd-release/template.go @@ -1,14 +1,14 @@ package main -const releaseNotes = `Welcome to the release of containerd {{.Version}}! +const releaseNotes = `Welcome to the release of {{.ProjectName}} {{.Version}}! {{if .PreRelease}} -*This is a pre-release of containerd* +*This is a pre-release of {{.ProjectName}}* {{- end}} {{.Preface}} Please try out the release binaries and report any issues at -https://github.com/containerd/containerd/issues. +https://github.com/{{.GithubRepo}}/issues. {{range $note := .Notes}} ### {{$note.Title}} @@ -28,7 +28,7 @@ https://github.com/containerd/containerd/issues. ### Dependency Changes -Previous release can be found at [{{.Previous}}](https://github.com/containerd/containerd/releases/tag/{{.Previous}}) +Previous release can be found at [{{.Previous}}](https://github.com/{{.GithubRepo}}/releases/tag/{{.Previous}}) {{range $dep := .Dependencies}} * {{$dep.Previous}} -> {{$dep.Commit}} **{{$dep.Name}}** {{- end}} diff --git a/releases/v1.0.0-beta.2.toml b/releases/v1.0.0-beta.2.toml index d6b5ad8d9..fc5b2ea1f 100644 --- a/releases/v1.0.0-beta.2.toml +++ b/releases/v1.0.0-beta.2.toml @@ -1,6 +1,9 @@ # commit to be tagged for new release commit = "HEAD" +project_name = "containerd" +github_repo = "containerd/containerd" + # previous release previous = "v1.0.0-beta.1"