-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Golang implementation of release note generating tool.
This is a duplication of the shell script "relnotes". Commits have been squashed. Original commits can be found at https://github.com/roycaihw/release/tree/relnotes-dev
- Loading branch information
Showing
15 changed files
with
1,872 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# TODO: Remove this default once rules_go is bumped. | ||
# Ref kubernetes/kubernetes#52677 | ||
build --incompatible_comprehension_variables_do_not_leak=false | ||
# TODO: remove the following once repo-infra is bumped. | ||
build --incompatible_disallow_set_constructor=false |
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,8 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "gazelle") | ||
|
||
gazelle( | ||
name = "gazelle", | ||
prefix = "k8s.io/release", | ||
external = "vendored", | ||
) | ||
|
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 +1,12 @@ | ||
workspace(name = "io_kubernetes_build") | ||
http_archive( | ||
name = "io_bazel_rules_go", | ||
url = "https://github.com/bazelbuild/rules_go/releases/download/0.6.0/rules_go-0.6.0.tar.gz", | ||
sha256 = "ba6feabc94a5d205013e70792accb6cce989169476668fbaf98ea9b342e13b59", | ||
) | ||
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") | ||
go_rules_dependencies() | ||
go_register_toolchains() | ||
|
||
load("@io_bazel_rules_go//proto:def.bzl", "proto_register_toolchains") | ||
proto_register_toolchains() |
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,27 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = ["main.go"], | ||
importpath = "k8s.io/release/toolbox/relnotes", | ||
visibility = ["//visibility:private"], | ||
deps = [ | ||
"//toolbox/util:go_default_library", | ||
"//vendor/github.com/google/go-github/github:go_default_library", | ||
], | ||
) | ||
|
||
go_binary( | ||
name = "relnotes", | ||
importpath = "k8s.io/release/toolbox/relnotes", | ||
library = ":go_default_library", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
go_test( | ||
name = "go_default_test", | ||
srcs = ["main_test.go"], | ||
importpath = "k8s.io/release/toolbox/relnotes", | ||
library = ":go_default_library", | ||
deps = ["//toolbox/util:go_default_library"], | ||
) |
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,45 @@ | ||
# Release Notes Collector | ||
|
||
This is a Golang implementation of existing release note collector | ||
[relnotes](https://github.com/kubernetes/release/blob/master/relnotes). | ||
|
||
Golang requires this repo being placed within $GOPATH, explicitly at | ||
$GOPATH/src/k8s.io/release. | ||
|
||
This tool also uses [dep](https://github.com/golang/dep) to manage Golang | ||
dependencies. To install dep, follow the instructions in [dep's Github | ||
page](https://github.com/golang/dep). | ||
|
||
**To bulid, run the build script:** | ||
|
||
`./build.sh` | ||
|
||
**Or do it manually:** | ||
|
||
`cd $GOPATH/src/k8s.io/release` | ||
|
||
`dep ensure` | ||
|
||
`bazel run //:gazelle` | ||
|
||
`bazel build toolbox/relnotes:relnotes` | ||
|
||
**Some example command gathering release notes for Kubernetes (assume currently in | ||
a kubernetes repo):** | ||
|
||
* (On branch release-1.7:) | ||
|
||
`../release/bazel-bin/toolbox/relnotes/relnotes --preview --htmlize-md | ||
--html-file /tmp/release-note-html-testfile | ||
--release-tars=_output/release-tars v1.7.0..v1.7.2` | ||
|
||
* (On branch release-1.7:) | ||
|
||
`../release/bazel-bin/toolbox/relnotes/relnotes --preview --html-file | ||
/tmp/release-note-html-testfile --release-tars=_output/release-tars | ||
v1.7.0..v1.7.0` | ||
|
||
* (On branch release-1.6.3:) | ||
|
||
`../release/bazel-bin/toolbox/relnotes/relnotes --html-file | ||
/tmp/release-note-html-testfile --full` |
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,16 @@ | ||
#!/bin/bash | ||
|
||
# This is a build script for Golang relnotes (release note collector), see | ||
# README.md for more information. | ||
|
||
# At the root directory | ||
cd $GOPATH/src/k8s.io/release | ||
|
||
# Run dep to get the dependencies | ||
dep ensure | ||
|
||
# Run gazelle to auto-generate BUILD files | ||
bazel run //:gazelle | ||
|
||
# Build the program | ||
bazel build toolbox/relnotes:relnotes |
Oops, something went wrong.