Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
c9a4da42
Commit
c9a4da42
authored
Nov 06, 2018
by
Leonard Gram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: publisher handles nightly builds.
parent
26cbc6be
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
13 deletions
+28
-13
scripts/build/release_publisher/externalrelease.go
+3
-3
scripts/build/release_publisher/localrelease.go
+2
-2
scripts/build/release_publisher/main.go
+20
-5
scripts/build/release_publisher/publisher.go
+3
-3
No files found.
scripts/build/release_publisher/externalrelease.go
View file @
c9a4da42
...
...
@@ -14,7 +14,7 @@ type releaseFromExternalContent struct {
artifactConfigurations
[]
buildArtifact
}
func
(
re
releaseFromExternalContent
)
prepareRelease
(
baseArchiveUrl
,
whatsNewUrl
string
,
releaseNotesUrl
string
)
(
*
release
,
error
)
{
func
(
re
releaseFromExternalContent
)
prepareRelease
(
baseArchiveUrl
,
whatsNewUrl
string
,
releaseNotesUrl
string
,
nightly
bool
)
(
*
release
,
error
)
{
version
:=
re
.
rawVersion
[
1
:
]
isBeta
:=
strings
.
Contains
(
version
,
"beta"
)
...
...
@@ -30,9 +30,9 @@ func (re releaseFromExternalContent) prepareRelease(baseArchiveUrl, whatsNewUrl
r
:=
release
{
Version
:
version
,
ReleaseDate
:
time
.
Now
()
.
UTC
(),
Stable
:
!
isBeta
,
Stable
:
!
isBeta
&&
!
nightly
,
Beta
:
isBeta
,
Nightly
:
false
,
Nightly
:
nightly
,
WhatsNewUrl
:
whatsNewUrl
,
ReleaseNotesUrl
:
releaseNotesUrl
,
Builds
:
builds
,
...
...
scripts/build/release_publisher/localrelease.go
View file @
c9a4da42
...
...
@@ -17,7 +17,7 @@ type releaseLocalSources struct {
artifactConfigurations
[]
buildArtifact
}
func
(
r
releaseLocalSources
)
prepareRelease
(
baseArchiveUrl
,
whatsNewUrl
string
,
releaseNotesUrl
string
)
(
*
release
,
error
)
{
func
(
r
releaseLocalSources
)
prepareRelease
(
baseArchiveUrl
,
whatsNewUrl
string
,
releaseNotesUrl
string
,
nightly
bool
)
(
*
release
,
error
)
{
buildData
:=
r
.
findBuilds
(
baseArchiveUrl
)
rel
:=
release
{
...
...
@@ -25,7 +25,7 @@ func (r releaseLocalSources) prepareRelease(baseArchiveUrl, whatsNewUrl string,
ReleaseDate
:
time
.
Now
()
.
UTC
(),
Stable
:
false
,
Beta
:
false
,
Nightly
:
true
,
Nightly
:
nightly
,
WhatsNewUrl
:
whatsNewUrl
,
ReleaseNotesUrl
:
releaseNotesUrl
,
Builds
:
buildData
.
builds
,
...
...
scripts/build/release_publisher/main.go
View file @
c9a4da42
...
...
@@ -14,6 +14,7 @@ func main() {
var
dryRun
bool
var
enterprise
bool
var
fromLocal
bool
var
nightly
bool
var
apiKey
string
flag
.
StringVar
(
&
version
,
"version"
,
""
,
"Grafana version (ex: --version v5.2.0-beta1)"
)
...
...
@@ -22,11 +23,13 @@ func main() {
flag
.
StringVar
(
&
apiKey
,
"apikey"
,
""
,
"Grafana.com API key (ex: --apikey ABCDEF)"
)
flag
.
BoolVar
(
&
dryRun
,
"dry-run"
,
false
,
"--dry-run"
)
flag
.
BoolVar
(
&
enterprise
,
"enterprise"
,
false
,
"--enterprise"
)
flag
.
BoolVar
(
&
fromLocal
,
"from-local"
,
false
,
"--from-local"
)
flag
.
BoolVar
(
&
fromLocal
,
"from-local"
,
false
,
"--from-local
(builds will be tagged as nightly)
"
)
flag
.
Parse
()
nightly
=
fromLocal
if
len
(
os
.
Args
)
==
1
{
fmt
.
Println
(
"Usage: go run publisher.go main.go --version <v> --wn <what's new url> --rn <release notes url> --apikey <api key> --dry-run false --enterprise false"
)
fmt
.
Println
(
"Usage: go run publisher.go main.go --version <v> --wn <what's new url> --rn <release notes url> --apikey <api key> --dry-run false --enterprise false
--nightly false
"
)
fmt
.
Println
(
"example: go run publisher.go main.go --version v5.2.0-beta2 --wn http://docs.grafana.org/guides/whats-new-in-v5-2/ --rn https://community.grafana.com/t/release-notes-v5-2-x/7894 --apikey ASDF123 --dry-run --enterprise"
)
os
.
Exit
(
1
)
}
...
...
@@ -52,12 +55,14 @@ func main() {
}
}
archiveProviderRoot
:=
"https://s3-us-west-2.amazonaws.com"
if
enterprise
{
baseUrl
=
"https://s3-us-west-2.amazonaws.com/grafana-enterprise-releases/release/grafana-enterprise"
product
=
"grafana-enterprise"
baseUrl
=
createBaseUrl
(
archiveProviderRoot
,
"grafana-enterprise-releases"
,
product
,
nightly
)
}
else
{
baseUrl
=
"https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana"
product
=
"grafana"
baseUrl
=
createBaseUrl
(
archiveProviderRoot
,
"grafana-releases"
,
product
,
nightly
)
}
p
:=
publisher
{
...
...
@@ -69,7 +74,17 @@ func main() {
baseArchiveUrl
:
baseUrl
,
builder
:
builder
,
}
if
err
:=
p
.
doRelease
(
whatsNewUrl
,
releaseNotesUrl
);
err
!=
nil
{
if
err
:=
p
.
doRelease
(
whatsNewUrl
,
releaseNotesUrl
,
nightly
);
err
!=
nil
{
log
.
Fatalf
(
"error: %v"
,
err
)
}
}
func
createBaseUrl
(
root
string
,
bucketName
string
,
product
string
,
nightly
bool
)
string
{
var
subPath
string
if
nightly
{
subPath
=
"master"
}
else
{
subPath
=
"release"
}
return
fmt
.
Sprintf
(
"%s/%s/%s/%s"
,
root
,
bucketName
,
subPath
,
product
)
}
scripts/build/release_publisher/publisher.go
View file @
c9a4da42
...
...
@@ -22,11 +22,11 @@ type publisher struct {
}
type
releaseBuilder
interface
{
prepareRelease
(
baseArchiveUrl
,
whatsNewUrl
string
,
releaseNotesUrl
string
)
(
*
release
,
error
)
prepareRelease
(
baseArchiveUrl
,
whatsNewUrl
string
,
releaseNotesUrl
string
,
nightly
bool
)
(
*
release
,
error
)
}
func
(
p
*
publisher
)
doRelease
(
whatsNewUrl
string
,
releaseNotesUrl
string
)
error
{
currentRelease
,
err
:=
p
.
builder
.
prepareRelease
(
p
.
baseArchiveUrl
,
whatsNewUrl
,
releaseNotesUrl
)
func
(
p
*
publisher
)
doRelease
(
whatsNewUrl
string
,
releaseNotesUrl
string
,
nightly
bool
)
error
{
currentRelease
,
err
:=
p
.
builder
.
prepareRelease
(
p
.
baseArchiveUrl
,
whatsNewUrl
,
releaseNotesUrl
,
nightly
)
if
err
!=
nil
{
return
err
}
...
...
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