Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b6cd4bed
Commit
b6cd4bed
authored
May 26, 2015
by
Jeff Lowdermilk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optionally use a github api token when compiling relase-notes
parent
145386ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
12 deletions
+30
-12
make-release-notes.sh
build/make-release-notes.sh
+6
-7
release-notes.go
contrib/release-notes/release-notes.go
+24
-5
No files found.
build/make-release-notes.sh
View file @
b6cd4bed
...
@@ -24,19 +24,18 @@ function pop_dir {
...
@@ -24,19 +24,18 @@ function pop_dir {
}
}
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
if
[[
-z
"
${
1
:-}
"
]]
;
then
if
[[
-z
"
${
1
:-}
"
]]
;
then
echo
"Usage:
${
0
}
<pr-number>"
echo
"Usage:
${
0
}
<pr-number>
[opts]
"
exit
1
exit
1
fi
fi
pushd
.
>
/dev/null
pushd
.
>
/dev/null
trap
'pop_dir'
INT TERM EXIT
trap
'pop_dir'
INT TERM EXIT
cd
${
KUBE_ROOT
}
/contrib/release-notes
kube::golang::build_binaries contrib/release-notes
# TODO: vendor these dependencies, but using godep again will be annoying...
kube::golang::place_bins
GOPATH
=
$PWD
go get github.com/google/go-github/github
releasenotes
=
$(
kube::util::find-binary
"release-notes"
)
GOPATH
=
$PWD
go get github.com/google/go-querystring/query
"
${
releasenotes
}
"
--last-release-pr
=
${
1
}
${
@
}
GOPATH
=
$PWD
go build release-notes.go
./release-notes
--last-release-pr
=
${
1
}
contrib/release-notes/release-notes.go
View file @
b6cd4bed
...
@@ -18,24 +18,43 @@ package main
...
@@ -18,24 +18,43 @@ package main
import
(
import
(
"bytes"
"bytes"
"flag"
"fmt"
"fmt"
"net/http"
"os"
"os"
"github.com/google/go-github/github"
"github.com/google/go-github/github"
flag
"github.com/spf13/pflag"
"golang.org/x/oauth2"
)
)
var
target
=
flag
.
Int
(
"last-release-pr"
,
0
,
"The PR number of the last versioned release."
)
var
(
target
int
token
string
)
func
init
()
{
flag
.
IntVar
(
&
target
,
"last-release-pr"
,
0
,
"The PR number of the last versioned release."
)
flag
.
StringVar
(
&
token
,
"api-token"
,
""
,
"Github api token for rate limiting. See https://developer.github.com/v3/#rate-limiting."
)
}
func
main
()
{
func
main
()
{
flag
.
Parse
()
flag
.
Parse
()
// Automatically determine this from github.
// Automatically determine this from github.
if
*
target
==
0
{
if
target
==
0
{
fmt
.
Printf
(
"--last-release-pr is required.
\n
"
)
fmt
.
Printf
(
"--last-release-pr is required.
\n
"
)
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
var
tc
*
http
.
Client
if
len
(
token
)
>
0
{
tc
=
oauth2
.
NewClient
(
oauth2
.
NoContext
,
oauth2
.
StaticTokenSource
(
&
oauth2
.
Token
{
AccessToken
:
token
}),
)
}
client
:=
github
.
NewClient
(
nil
)
client
:=
github
.
NewClient
(
tc
)
done
:=
false
done
:=
false
...
@@ -62,7 +81,7 @@ func main() {
...
@@ -62,7 +81,7 @@ func main() {
if
result
.
MergedAt
==
nil
{
if
result
.
MergedAt
==
nil
{
continue
continue
}
}
if
*
result
.
Number
==
*
target
{
if
*
result
.
Number
==
target
{
done
=
true
done
=
true
break
break
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment