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
9c50b89d
Commit
9c50b89d
authored
Feb 15, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(build): make build more generic for executables
parent
063b54ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
build.go
+10
-10
No files found.
build.go
View file @
9c50b89d
...
...
@@ -31,7 +31,7 @@ var (
linuxPackageIteration
string
=
""
race
bool
workingDir
string
serverBinaryName
string
=
"grafana-server"
binaries
[]
string
=
[]
string
{
"grafana-server"
,
"grafana-cli"
}
)
const
minGoVersion
=
1.3
...
...
@@ -64,8 +64,9 @@ func main() {
case
"build"
:
clean
()
build
(
serverBinaryName
,
"./pkg/cmd/grafana-server"
,
[]
string
{})
build
(
"grafana-cli"
,
"./pkg/cmd/grafana-cli"
,
[]
string
{})
for
_
,
binary
:=
range
binaries
{
build
(
binary
,
"./pkg/cmd/"
+
binary
,
[]
string
{})
}
case
"test"
:
test
(
"./pkg/..."
)
...
...
@@ -138,6 +139,7 @@ func readVersionFromPackageJson() {
type
linuxPackageOptions
struct
{
packageType
string
homeDir
string
binPath
string
serverBinPath
string
cliBinPath
string
configDir
string
...
...
@@ -160,8 +162,7 @@ func createDebPackages() {
createPackage
(
linuxPackageOptions
{
packageType
:
"deb"
,
homeDir
:
"/usr/share/grafana"
,
serverBinPath
:
"/usr/sbin/grafana-server"
,
cliBinPath
:
"/usr/sbin/grafana-cli"
,
binPath
:
"/usr/sbin"
,
configDir
:
"/etc/grafana"
,
configFilePath
:
"/etc/grafana/grafana.ini"
,
ldapFilePath
:
"/etc/grafana/ldap.toml"
,
...
...
@@ -183,8 +184,7 @@ func createRpmPackages() {
createPackage
(
linuxPackageOptions
{
packageType
:
"rpm"
,
homeDir
:
"/usr/share/grafana"
,
serverBinPath
:
"/usr/sbin/grafana-server"
,
cliBinPath
:
"/usr/sbin/grafana-cli"
,
binPath
:
"/usr/sbin"
,
configDir
:
"/etc/grafana"
,
configFilePath
:
"/etc/grafana/grafana.ini"
,
ldapFilePath
:
"/etc/grafana/ldap.toml"
,
...
...
@@ -219,9 +219,9 @@ func createPackage(options linuxPackageOptions) {
runPrint
(
"mkdir"
,
"-p"
,
filepath
.
Join
(
packageRoot
,
"/usr/sbin"
))
// copy binary
runPrint
(
"cp"
,
"-p"
,
filepath
.
Join
(
workingDir
,
"tmp/bin/grafana-server"
),
filepath
.
Join
(
packageRoot
,
options
.
serverBinPath
))
// copy binary
runPrint
(
"cp"
,
"-p"
,
filepath
.
Join
(
workingDir
,
"tmp/bin/grafana-cli"
),
filepath
.
Join
(
packageRoot
,
options
.
cliBinPath
))
for
_
,
binary
:=
range
binaries
{
runPrint
(
"cp"
,
"-p"
,
filepath
.
Join
(
workingDir
,
"tmp/bin/"
+
binary
),
filepath
.
Join
(
packageRoot
,
"/usr/sbin/"
+
binary
))
}
// copy init.d script
runPrint
(
"cp"
,
"-p"
,
options
.
initdScriptSrc
,
filepath
.
Join
(
packageRoot
,
options
.
initdScriptFilePath
))
// copy environment var file
...
...
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