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
630adfaf
Commit
630adfaf
authored
Sep 20, 2016
by
Carl Bergquist
Committed by
GitHub
Sep 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6068 from fg2it/cross
Cross build support
parents
ec452dd7
699c5153
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
41 deletions
+77
-41
.github/CONTRIBUTING.md
+1
-1
Gruntfile.js
+4
-1
README.md
+1
-1
build.go
+38
-4
tasks/options/phantomjs.js
+33
-34
No files found.
.github/CONTRIBUTING.md
View file @
630adfaf
...
@@ -12,7 +12,7 @@ grunt karma:dev
...
@@ -12,7 +12,7 @@ grunt karma:dev
### Run tests for backend assets before commit
### Run tests for backend assets before commit
```
```
test -z "$(gofmt -s -l . | grep -v
vendor/src/
| tee /dev/stderr)"
test -z "$(gofmt -s -l . | grep -v
-E 'vendor/(github.com|golang.org|gopkg.in)'
| tee /dev/stderr)"
```
```
### Run tests for frontend assets before commit
### Run tests for frontend assets before commit
...
...
Gruntfile.js
View file @
630adfaf
...
@@ -9,7 +9,6 @@ module.exports = function (grunt) {
...
@@ -9,7 +9,6 @@ module.exports = function (grunt) {
genDir
:
'public_gen'
,
genDir
:
'public_gen'
,
destDir
:
'dist'
,
destDir
:
'dist'
,
tempDir
:
'tmp'
,
tempDir
:
'tmp'
,
arch
:
os
.
arch
(),
platform
:
process
.
platform
.
replace
(
'win32'
,
'windows'
),
platform
:
process
.
platform
.
replace
(
'win32'
,
'windows'
),
};
};
...
@@ -17,6 +16,10 @@ module.exports = function (grunt) {
...
@@ -17,6 +16,10 @@ module.exports = function (grunt) {
config
.
arch
=
process
.
env
.
hasOwnProperty
(
'ProgramFiles(x86)'
)
?
'x64'
:
'x86'
;
config
.
arch
=
process
.
env
.
hasOwnProperty
(
'ProgramFiles(x86)'
)
?
'x64'
:
'x86'
;
}
}
config
.
arch
=
grunt
.
option
(
'arch'
)
||
os
.
arch
();
config
.
phjs
=
grunt
.
option
(
'phjsToRelease'
);
config
.
pkg
.
version
=
grunt
.
option
(
'pkgVer'
)
||
config
.
pkg
.
version
;
config
.
pkg
.
version
=
grunt
.
option
(
'pkgVer'
)
||
config
.
pkg
.
version
;
console
.
log
(
'Version'
,
config
.
pkg
.
version
);
console
.
log
(
'Version'
,
config
.
pkg
.
version
);
...
...
README.md
View file @
630adfaf
...
@@ -96,7 +96,7 @@ easily the grafana repository you want to build.
...
@@ -96,7 +96,7 @@ easily the grafana repository you want to build.
```
bash
```
bash
go get github.com/
*
your_account
*
/grafana
go get github.com/
*
your_account
*
/grafana
mkdir
$GOPATH
/src/github.com/grafana
mkdir
$GOPATH
/src/github.com/grafana
ln
-s
github.com/
*
your_account
*
/grafana
$GOPATH
/src/github.com/grafana/grafana
ln
-s
$GOPATH
/src/
github.com/
*
your_account
*
/grafana
$GOPATH
/src/github.com/grafana/grafana
```
```
### Building the backend
### Building the backend
...
...
build.go
View file @
630adfaf
...
@@ -25,11 +25,16 @@ var (
...
@@ -25,11 +25,16 @@ var (
versionRe
=
regexp
.
MustCompile
(
`-[0-9]{1,3}-g[0-9a-f]{5,10}`
)
versionRe
=
regexp
.
MustCompile
(
`-[0-9]{1,3}-g[0-9a-f]{5,10}`
)
goarch
string
goarch
string
goos
string
goos
string
gocc
string
gocxx
string
cgo
string
pkgArch
string
version
string
=
"v1"
version
string
=
"v1"
// deb & rpm does not support semver so have to handle their version a little differently
// deb & rpm does not support semver so have to handle their version a little differently
linuxPackageVersion
string
=
"v1"
linuxPackageVersion
string
=
"v1"
linuxPackageIteration
string
=
""
linuxPackageIteration
string
=
""
race
bool
race
bool
phjsToRelease
string
workingDir
string
workingDir
string
binaries
[]
string
=
[]
string
{
"grafana-server"
,
"grafana-cli"
}
binaries
[]
string
=
[]
string
{
"grafana-server"
,
"grafana-cli"
}
)
)
...
@@ -47,6 +52,11 @@ func main() {
...
@@ -47,6 +52,11 @@ func main() {
flag
.
StringVar
(
&
goarch
,
"goarch"
,
runtime
.
GOARCH
,
"GOARCH"
)
flag
.
StringVar
(
&
goarch
,
"goarch"
,
runtime
.
GOARCH
,
"GOARCH"
)
flag
.
StringVar
(
&
goos
,
"goos"
,
runtime
.
GOOS
,
"GOOS"
)
flag
.
StringVar
(
&
goos
,
"goos"
,
runtime
.
GOOS
,
"GOOS"
)
flag
.
StringVar
(
&
gocc
,
"cc"
,
""
,
"CC"
)
flag
.
StringVar
(
&
gocxx
,
"cxx"
,
""
,
"CXX"
)
flag
.
StringVar
(
&
cgo
,
"cgo-enabled"
,
""
,
"CGO_ENABLED"
)
flag
.
StringVar
(
&
pkgArch
,
"pkg-arch"
,
""
,
"PKG ARCH"
)
flag
.
StringVar
(
&
phjsToRelease
,
"phjs"
,
""
,
"PhantomJS binary"
)
flag
.
BoolVar
(
&
race
,
"race"
,
race
,
"Use race detector"
)
flag
.
BoolVar
(
&
race
,
"race"
,
race
,
"Use race detector"
)
flag
.
Parse
()
flag
.
Parse
()
...
@@ -73,15 +83,15 @@ func main() {
...
@@ -73,15 +83,15 @@ func main() {
grunt
(
"test"
)
grunt
(
"test"
)
case
"package"
:
case
"package"
:
grunt
(
"release"
,
fmt
.
Sprintf
(
"--pkgVer=%v-%v"
,
linuxPackageVersion
,
linuxPackageIteration
)
)
grunt
(
gruntBuildArg
(
"release"
)
...
)
createLinuxPackages
()
createLinuxPackages
()
case
"pkg-rpm"
:
case
"pkg-rpm"
:
grunt
(
"release"
)
grunt
(
gruntBuildArg
(
"release"
)
...
)
createRpmPackages
()
createRpmPackages
()
case
"pkg-deb"
:
case
"pkg-deb"
:
grunt
(
"release"
)
grunt
(
gruntBuildArg
(
"release"
)
...
)
createDebPackages
()
createDebPackages
()
case
"latest"
:
case
"latest"
:
...
@@ -258,6 +268,10 @@ func createPackage(options linuxPackageOptions) {
...
@@ -258,6 +268,10 @@ func createPackage(options linuxPackageOptions) {
"-p"
,
"./dist"
,
"-p"
,
"./dist"
,
}
}
if
pkgArch
!=
""
{
args
=
append
(
args
,
"-a"
,
pkgArch
)
}
if
linuxPackageIteration
!=
""
{
if
linuxPackageIteration
!=
""
{
args
=
append
(
args
,
"--iteration"
,
linuxPackageIteration
)
args
=
append
(
args
,
"--iteration"
,
linuxPackageIteration
)
}
}
...
@@ -307,9 +321,20 @@ func grunt(params ...string) {
...
@@ -307,9 +321,20 @@ func grunt(params ...string) {
runPrint
(
"./node_modules/.bin/grunt"
,
params
...
)
runPrint
(
"./node_modules/.bin/grunt"
,
params
...
)
}
}
func
gruntBuildArg
(
task
string
)
[]
string
{
args
:=
[]
string
{
task
,
fmt
.
Sprintf
(
"--pkgVer=%v-%v"
,
linuxPackageVersion
,
linuxPackageIteration
)}
if
pkgArch
!=
""
{
args
=
append
(
args
,
fmt
.
Sprintf
(
"--arch=%v"
,
pkgArch
))
}
if
phjsToRelease
!=
""
{
args
=
append
(
args
,
fmt
.
Sprintf
(
"--phjsToRelease=%v"
,
phjsToRelease
))
}
return
args
}
func
setup
()
{
func
setup
()
{
runPrint
(
"go"
,
"get"
,
"-v"
,
"github.com/kardianos/govendor"
)
runPrint
(
"go"
,
"get"
,
"-v"
,
"github.com/kardianos/govendor"
)
runPrint
(
"go"
,
"get"
,
"-v"
,
"github.com/blang/semver"
)
runPrint
(
"go"
,
"get"
,
"-v"
,
"github.com/blang/semver"
)
runPrint
(
"go"
,
"get"
,
"-v"
,
"github.com/mattn/go-sqlite3"
)
runPrint
(
"go"
,
"get"
,
"-v"
,
"github.com/mattn/go-sqlite3"
)
runPrint
(
"go"
,
"install"
,
"-v"
,
"github.com/mattn/go-sqlite3"
)
runPrint
(
"go"
,
"install"
,
"-v"
,
"github.com/mattn/go-sqlite3"
)
}
}
...
@@ -382,6 +407,15 @@ func setBuildEnv() {
...
@@ -382,6 +407,15 @@ func setBuildEnv() {
if
goarch
==
"386"
{
if
goarch
==
"386"
{
os
.
Setenv
(
"GO386"
,
"387"
)
os
.
Setenv
(
"GO386"
,
"387"
)
}
}
if
cgo
!=
""
{
os
.
Setenv
(
"CGO_ENABLED"
,
cgo
)
}
if
gocc
!=
""
{
os
.
Setenv
(
"CC"
,
gocc
)
}
if
gocxx
!=
""
{
os
.
Setenv
(
"CXX"
,
gocxx
)
}
}
}
func
getGitSha
()
string
{
func
getGitSha
()
string
{
...
...
tasks/options/phantomjs.js
View file @
630adfaf
module
.
exports
=
function
(
config
,
grunt
)
{
module
.
exports
=
function
(
config
,
grunt
)
{
'use strict'
;
'use strict'
;
grunt
.
registerTask
(
'phantomjs'
,
'Copy phantomjs binary from node'
,
function
()
{
grunt
.
registerTask
(
'phantomjs'
,
'Copy phantomjs binary to vendor/'
,
function
()
{
var
dest
=
'./vendor/phantomjs/phantomjs'
;
var
dest
=
'./vendor/phantomjs/phantomjs'
;
var
confDir
=
'./node_modules/phantomjs-prebuilt/lib/'
;
var
confDir
=
'./node_modules/phantomjs-prebuilt/lib/'
;
if
(
!
grunt
.
file
.
exists
(
dest
)){
src
=
config
.
phjs
var
m
=
grunt
.
file
.
read
(
confDir
+
"location.js"
)
if
(
!
src
){
var
src
=
/=
\"([^\"]
*
)\"
/
.
exec
(
m
)[
1
];
var
m
=
grunt
.
file
.
read
(
confDir
+
"location.js"
)
var
src
=
/=
\"([^\"]
*
)\"
/
.
exec
(
m
)[
1
];
if
(
!
grunt
.
file
.
isPathAbsolute
(
src
))
{
src
=
confDir
+
src
;
if
(
!
grunt
.
file
.
isPathAbsolute
(
src
))
{
}
src
=
confDir
+
src
;
}
try
{
}
grunt
.
config
(
'copy.phantom_bin'
,
{
src
:
src
,
try
{
dest
:
dest
,
grunt
.
config
(
'copy.phantom_bin'
,
{
options
:
{
mode
:
true
},
src
:
src
,
});
dest
:
dest
,
grunt
.
task
.
run
(
'copy:phantom_bin'
);
options
:
{
mode
:
true
},
}
catch
(
err
)
{
});
grunt
.
verbose
.
writeln
(
err
);
grunt
.
task
.
run
(
'copy:phantom_bin'
);
grunt
.
fail
.
warn
(
'No working Phantomjs binary available'
)
}
catch
(
err
)
{
}
grunt
.
verbose
.
writeln
(
err
);
grunt
.
fail
.
warn
(
'No working Phantomjs binary available'
)
}
else
{
}
grunt
.
log
.
writeln
(
'Phantomjs already imported from node'
);
}
});
});
};
};
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