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
2d361eea
Commit
2d361eea
authored
Nov 19, 2018
by
Leonard Gram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builds: introduces enum for relase type.
parent
e2007733
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
+19
-7
scripts/build/release_publisher/externalrelease.go
+6
-2
scripts/build/release_publisher/localrelease.go
+1
-1
scripts/build/release_publisher/publisher.go
+12
-4
No files found.
scripts/build/release_publisher/externalrelease.go
View file @
2d361eea
...
@@ -17,14 +17,18 @@ type releaseFromExternalContent struct {
...
@@ -17,14 +17,18 @@ type releaseFromExternalContent struct {
func
(
re
releaseFromExternalContent
)
prepareRelease
(
baseArchiveUrl
,
whatsNewUrl
string
,
releaseNotesUrl
string
,
nightly
bool
)
(
*
release
,
error
)
{
func
(
re
releaseFromExternalContent
)
prepareRelease
(
baseArchiveUrl
,
whatsNewUrl
string
,
releaseNotesUrl
string
,
nightly
bool
)
(
*
release
,
error
)
{
version
:=
re
.
rawVersion
[
1
:
]
version
:=
re
.
rawVersion
[
1
:
]
isBeta
:=
strings
.
Contains
(
version
,
"beta"
)
isBeta
:=
strings
.
Contains
(
version
,
"beta"
)
var
rt
ReleaseType
if
isBeta
{
rt
=
BETA
}
builds
:=
[]
build
{}
builds
:=
[]
build
{}
for
_
,
ba
:=
range
re
.
artifactConfigurations
{
for
_
,
ba
:=
range
re
.
artifactConfigurations
{
sha256
,
err
:=
re
.
getter
.
getContents
(
fmt
.
Sprintf
(
"%s.sha256"
,
ba
.
getUrl
(
baseArchiveUrl
,
version
,
isBeta
)))
sha256
,
err
:=
re
.
getter
.
getContents
(
fmt
.
Sprintf
(
"%s.sha256"
,
ba
.
getUrl
(
baseArchiveUrl
,
version
,
rt
)))
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
builds
=
append
(
builds
,
newBuild
(
baseArchiveUrl
,
ba
,
version
,
isBeta
,
sha256
))
builds
=
append
(
builds
,
newBuild
(
baseArchiveUrl
,
ba
,
version
,
rt
,
sha256
))
}
}
r
:=
release
{
r
:=
release
{
...
...
scripts/build/release_publisher/localrelease.go
View file @
2d361eea
...
@@ -70,7 +70,7 @@ func createBuildWalker(path string, data *buildData, archiveTypes []buildArtifac
...
@@ -70,7 +70,7 @@ func createBuildWalker(path string, data *buildData, archiveTypes []buildArtifac
data
.
version
=
version
data
.
version
=
version
data
.
builds
=
append
(
data
.
builds
,
build
{
data
.
builds
=
append
(
data
.
builds
,
build
{
Os
:
archive
.
os
,
Os
:
archive
.
os
,
Url
:
archive
.
getUrl
(
baseArchiveUrl
,
version
,
false
),
Url
:
archive
.
getUrl
(
baseArchiveUrl
,
version
,
NIGHTLY
),
Sha256
:
string
(
shaBytes
),
Sha256
:
string
(
shaBytes
),
Arch
:
archive
.
arch
,
Arch
:
archive
.
arch
,
})
})
...
...
scripts/build/release_publisher/publisher.go
View file @
2d361eea
...
@@ -61,13 +61,21 @@ func (p *publisher) postRelease(r *release) error {
...
@@ -61,13 +61,21 @@ func (p *publisher) postRelease(r *release) error {
return
nil
return
nil
}
}
type
ReleaseType
int
const
(
STABLE
ReleaseType
=
iota
+
1
BETA
NIGHTLY
)
type
buildArtifact
struct
{
type
buildArtifact
struct
{
os
string
os
string
arch
string
arch
string
urlPostfix
string
urlPostfix
string
}
}
func
(
t
buildArtifact
)
getUrl
(
baseArchiveUrl
,
version
string
,
isBeta
bool
)
string
{
func
(
t
buildArtifact
)
getUrl
(
baseArchiveUrl
,
version
string
,
rt
ReleaseType
)
string
{
prefix
:=
"-"
prefix
:=
"-"
rhelReleaseExtra
:=
""
rhelReleaseExtra
:=
""
...
@@ -75,7 +83,7 @@ func (t buildArtifact) getUrl(baseArchiveUrl, version string, isBeta bool) strin
...
@@ -75,7 +83,7 @@ func (t buildArtifact) getUrl(baseArchiveUrl, version string, isBeta bool) strin
prefix
=
"_"
prefix
=
"_"
}
}
if
!
isBeta
&&
t
.
os
==
"rhel"
{
if
rt
==
BETA
&&
t
.
os
==
"rhel"
{
rhelReleaseExtra
=
"-1"
rhelReleaseExtra
=
"-1"
}
}
...
@@ -141,10 +149,10 @@ var buildArtifactConfigurations = []buildArtifact{
...
@@ -141,10 +149,10 @@ var buildArtifactConfigurations = []buildArtifact{
},
},
}
}
func
newBuild
(
baseArchiveUrl
string
,
ba
buildArtifact
,
version
string
,
isBeta
bool
,
sha256
string
)
build
{
func
newBuild
(
baseArchiveUrl
string
,
ba
buildArtifact
,
version
string
,
rt
ReleaseType
,
sha256
string
)
build
{
return
build
{
return
build
{
Os
:
ba
.
os
,
Os
:
ba
.
os
,
Url
:
ba
.
getUrl
(
baseArchiveUrl
,
version
,
isBeta
),
Url
:
ba
.
getUrl
(
baseArchiveUrl
,
version
,
rt
),
Sha256
:
sha256
,
Sha256
:
sha256
,
Arch
:
ba
.
arch
,
Arch
:
ba
.
arch
,
}
}
...
...
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