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
ac6b5ea7
Commit
ac6b5ea7
authored
Jan 30, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tech(build): option to not include buildIteration in package name
parent
16303659
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
build.go
+15
-5
No files found.
build.go
View file @
ac6b5ea7
...
...
@@ -37,6 +37,7 @@ var (
race
bool
phjsToRelease
string
workingDir
string
includeBuildNumber
bool
=
true
binaries
[]
string
=
[]
string
{
"grafana-server"
,
"grafana-cli"
}
)
...
...
@@ -47,9 +48,6 @@ func main() {
log
.
SetFlags
(
0
)
ensureGoPath
()
readVersionFromPackageJson
()
log
.
Printf
(
"Version: %s, Linux Version: %s, Package Iteration: %s
\n
"
,
version
,
linuxPackageVersion
,
linuxPackageIteration
)
flag
.
StringVar
(
&
goarch
,
"goarch"
,
runtime
.
GOARCH
,
"GOARCH"
)
flag
.
StringVar
(
&
goos
,
"goos"
,
runtime
.
GOOS
,
"GOOS"
)
...
...
@@ -59,8 +57,13 @@ func main() {
flag
.
StringVar
(
&
pkgArch
,
"pkg-arch"
,
""
,
"PKG ARCH"
)
flag
.
StringVar
(
&
phjsToRelease
,
"phjs"
,
""
,
"PhantomJS binary"
)
flag
.
BoolVar
(
&
race
,
"race"
,
race
,
"Use race detector"
)
flag
.
BoolVar
(
&
includeBuildNumber
,
"includeBuildNumber"
,
includeBuildNumber
,
"IncludeBuildNumber in package name"
)
flag
.
Parse
()
readVersionFromPackageJson
()
log
.
Printf
(
"Version: %s, Linux Version: %s, Package Iteration: %s
\n
"
,
version
,
linuxPackageVersion
,
linuxPackageIteration
)
if
flag
.
NArg
()
==
0
{
log
.
Println
(
"Usage: go run build.go build"
)
return
...
...
@@ -153,7 +156,9 @@ func readVersionFromPackageJson() {
}
// add timestamp to iteration
linuxPackageIteration
=
fmt
.
Sprintf
(
"%d%s"
,
time
.
Now
()
.
Unix
(),
linuxPackageIteration
)
if
includeBuildNumber
{
linuxPackageIteration
=
fmt
.
Sprintf
(
"%d%s"
,
time
.
Now
()
.
Unix
(),
linuxPackageIteration
)
}
}
type
linuxPackageOptions
struct
{
...
...
@@ -319,7 +324,12 @@ func grunt(params ...string) {
}
func
gruntBuildArg
(
task
string
)
[]
string
{
args
:=
[]
string
{
task
,
fmt
.
Sprintf
(
"--pkgVer=%v-%v"
,
linuxPackageVersion
,
linuxPackageIteration
)}
var
args
[]
string
if
includeBuildNumber
{
args
=
append
(
args
,
fmt
.
Sprintf
(
"--pkgVer=%v-%v"
,
linuxPackageVersion
,
linuxPackageIteration
))
}
else
{
args
=
append
(
args
,
fmt
.
Sprintf
(
"--pkgVer=%v"
,
linuxPackageVersion
))
}
if
pkgArch
!=
""
{
args
=
append
(
args
,
fmt
.
Sprintf
(
"--arch=%v"
,
pkgArch
))
}
...
...
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