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
6e802dc9
Commit
6e802dc9
authored
Mar 22, 2019
by
Leonard Gram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: builds armv6 with rpi1 compat gcc.
parent
35965e0e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
29 deletions
+77
-29
.circleci/config.yml
+20
-0
build.go
+33
-12
scripts/build/build-all.sh
+10
-7
scripts/build/build.sh
+11
-7
scripts/build/ci-build/Dockerfile
+3
-3
No files found.
.circleci/config.yml
View file @
6e802dc9
...
...
@@ -439,6 +439,15 @@ jobs:
name
:
Update RPM repository
command
:
'
./scripts/build/update_repo/update-rpm.sh
"oss"
"$GPG_KEY_PASSWORD"
"$CIRCLE_TAG"
"dist"'
store-build-artifacts
:
docker
:
-
image
:
circleci/node:8
steps
:
-
attach_workspace
:
at
:
.
-
store_artifacts
:
path
:
./dist
workflows
:
version
:
2
build-master
:
...
...
@@ -572,3 +581,14 @@ workflows:
-
postgres-integration-test
-
cache-server-test
filters
:
*filter-not-release-or-master
-
store-build-artifacts
:
requires
:
-
build
-
test-backend
-
test-frontend
-
codespell
-
gometalinter
-
mysql-integration-test
-
postgres-integration-test
-
cache-server-test
filters
:
*filter-not-release-or-master
build.go
View file @
6e802dc9
...
...
@@ -48,6 +48,7 @@ var (
enterprise
bool
=
false
skipRpmGen
bool
=
false
skipDebGen
bool
=
false
printGenVersion
bool
=
false
)
func
main
()
{
...
...
@@ -71,6 +72,7 @@ func main() {
flag
.
BoolVar
(
&
isDev
,
"dev"
,
isDev
,
"optimal for development, skips certain steps"
)
flag
.
BoolVar
(
&
skipRpmGen
,
"skipRpm"
,
skipRpmGen
,
"skip rpm package generation (default: false)"
)
flag
.
BoolVar
(
&
skipDebGen
,
"skipDeb"
,
skipDebGen
,
"skip deb package generation (default: false)"
)
flag
.
BoolVar
(
&
printGenVersion
,
"gen-version"
,
printGenVersion
,
"generate Grafana version and output (default: false)"
)
flag
.
Parse
()
buildId
=
shortenBuildId
(
buildIdRaw
)
...
...
@@ -81,6 +83,11 @@ func main() {
pkgArch
=
goarch
}
if
printGenVersion
{
printGeneratedVersion
()
return
}
log
.
Printf
(
"Version: %s, Linux Version: %s, Package Iteration: %s
\n
"
,
version
,
linuxPackageVersion
,
linuxPackageIteration
)
if
flag
.
NArg
()
==
0
{
...
...
@@ -221,6 +228,7 @@ func readVersionFromPackageJson() {
type
linuxPackageOptions
struct
{
packageType
string
packageArch
string
homeDir
string
binPath
string
serverBinPath
string
...
...
@@ -241,14 +249,14 @@ type linuxPackageOptions struct {
}
func
createDebPackages
()
{
previousPkgArch
:=
pkgArch
if
pkgArch
==
"armv7"
{
pkgArch
=
"armhf"
}
else
if
pkgArch
==
"armv6"
{
pkgArch
=
"armel"
debPkgArch
:=
pkgArch
if
pkgArch
==
"armv7"
||
pkgArch
==
"armv6"
{
debPkgArch
=
"armhf"
}
createPackage
(
linuxPackageOptions
{
packageType
:
"deb"
,
packageArch
:
debPkgArch
,
homeDir
:
"/usr/share/grafana"
,
binPath
:
"/usr/sbin"
,
configDir
:
"/etc/grafana"
,
...
...
@@ -264,19 +272,19 @@ func createDebPackages() {
depends
:
[]
string
{
"adduser"
,
"libfontconfig"
},
})
pkgArch
=
previousPkgArch
}
func
createRpmPackages
()
{
previous
PkgArch
:=
pkgArch
rpm
PkgArch
:=
pkgArch
switch
{
case
pkgArch
==
"armv7"
:
p
kgArch
=
"armhfp"
rpmP
kgArch
=
"armhfp"
case
pkgArch
==
"arm64"
:
p
kgArch
=
"aarch64"
rpmP
kgArch
=
"aarch64"
}
createPackage
(
linuxPackageOptions
{
packageType
:
"rpm"
,
packageArch
:
rpmPkgArch
,
homeDir
:
"/usr/share/grafana"
,
binPath
:
"/usr/sbin"
,
configDir
:
"/etc/grafana"
,
...
...
@@ -292,7 +300,6 @@ func createRpmPackages() {
depends
:
[]
string
{
"/sbin/service"
,
"fontconfig"
,
"freetype"
,
"urw-fonts"
},
})
pkgArch
=
previousPkgArch
}
func
createLinuxPackages
()
{
...
...
@@ -351,6 +358,10 @@ func createPackage(options linuxPackageOptions) {
name
+=
"-enterprise"
args
=
append
(
args
,
"--replaces"
,
"grafana"
)
}
fmt
.
Printf
(
"pkgArch is set to '%s', generated arch is '%s'
\n
"
,
pkgArch
,
options
.
packageArch
)
if
pkgArch
==
"armv6"
{
name
+=
"-rpi"
}
args
=
append
(
args
,
"--name"
,
name
)
description
:=
"Grafana"
...
...
@@ -371,8 +382,8 @@ func createPackage(options linuxPackageOptions) {
args
=
append
(
args
,
"--deb-no-default-config-files"
)
}
if
pkg
Arch
!=
""
{
args
=
append
(
args
,
"-a"
,
pkg
Arch
)
if
options
.
package
Arch
!=
""
{
args
=
append
(
args
,
"-a"
,
options
.
package
Arch
)
}
if
linuxPackageIteration
!=
""
{
...
...
@@ -437,6 +448,16 @@ func setup() {
runPrint
(
"go"
,
"install"
,
"-v"
,
"./pkg/cmd/grafana-server"
)
}
func
printGeneratedVersion
()
{
var
genVersion
string
if
includeBuildId
{
genVersion
=
fmt
.
Sprintf
(
"%v-%v"
,
linuxPackageVersion
,
linuxPackageIteration
)
}
else
{
genVersion
=
version
}
fmt
.
Print
(
genVersion
)
}
func
test
(
pkg
string
)
{
setBuildEnv
()
runPrint
(
"go"
,
"test"
,
"-short"
,
"-timeout"
,
"60s"
,
pkg
)
...
...
scripts/build/build-all.sh
View file @
6e802dc9
...
...
@@ -8,6 +8,7 @@ set -e
EXTRA_OPTS
=
"
$@
"
CCARMV6
=
/opt/rpi-tools/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
CCARMV7
=
arm-linux-gnueabihf-gcc
CCARM64
=
aarch64-linux-gnu-gcc
CCOSX64
=
/tmp/osxcross/target/bin/o64-clang
...
...
@@ -29,10 +30,18 @@ else
fi
echo
"Build arguments:
$OPT
"
echo
"current dir:
$(
pwd
)
"
if
[
-d
"dist"
]
;
then
rm
-rf
dist
fi
mkdir dist
go run build.go
-gen-version
${
OPT
}
>
dist/grafana.version
# build only amd64 for enterprise
if
echo
"
$EXTRA_OPTS
"
|
grep
-vq
enterprise
;
then
go run build.go
-goarch
armv6
-cc
${
CCARMV7
}
${
OPT
}
build
go run build.go
-goarch
armv6
-cc
${
CCARMV6
}
${
OPT
}
build
go run build.go
-goarch
armv7
-cc
${
CCARMV7
}
${
OPT
}
build
go run build.go
-goarch
arm64
-cc
${
CCARM64
}
${
OPT
}
build
go run build.go
-goos
darwin
-cc
${
CCOSX64
}
${
OPT
}
build
...
...
@@ -45,12 +54,6 @@ CC=${CCX64} go run build.go ${OPT} build
yarn install
--pure-lockfile
--no-progress
echo
"current dir:
$(
pwd
)
"
if
[
-d
"dist"
]
;
then
rm
-rf
dist
fi
if
[
"
$CIRCLE_TAG
"
!=
""
]
;
then
echo
"Building frontend and packaging from tag
$CIRCLE_TAG
"
else
...
...
scripts/build/build.sh
View file @
6e802dc9
...
...
@@ -8,6 +8,7 @@ set -e
EXTRA_OPTS
=
"
$@
"
CCARMV6
=
/opt/rpi-tools/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
CCARMV7
=
arm-linux-gnueabihf-gcc
CCARM64
=
aarch64-linux-gnu-gcc
CCX64
=
/tmp/x86_64-centos6-linux-gnu/bin/x86_64-centos6-linux-gnu-gcc
...
...
@@ -26,9 +27,18 @@ else
OPT
=
"-buildId=
${
CIRCLE_WORKFLOW_ID
}
${
EXTRA_OPTS
}
"
fi
echo
"Build arguments:
$OPT
"
echo
"current dir:
$(
pwd
)
"
if
[
-d
"dist"
]
;
then
rm
-rf
dist
fi
mkdir dist
go run build.go
-gen-version
${
OPT
}
>
dist/grafana.version
go run build.go
-goarch
armv6
-cc
${
CCARMV
7
}
${
OPT
}
build
go run build.go
-goarch
armv6
-cc
${
CCARMV
6
}
${
OPT
}
build
go run build.go
-goarch
armv7
-cc
${
CCARMV7
}
${
OPT
}
build
go run build.go
-goarch
arm64
-cc
${
CCARM64
}
${
OPT
}
build
...
...
@@ -36,12 +46,6 @@ CC=${CCX64} go run build.go ${OPT} build
yarn install
--pure-lockfile
--no-progress
echo
"current dir:
$(
pwd
)
"
if
[
-d
"dist"
]
;
then
rm
-rf
dist
fi
echo
"Building frontend"
go run build.go
${
OPT
}
build-frontend
...
...
scripts/build/ci-build/Dockerfile
View file @
6e802dc9
...
...
@@ -103,7 +103,8 @@ RUN apt-get update && \
| tee /etc/apt/sources.list.d/yarn.list
&&
\
apt-get update
&&
apt-get install
--no-install-recommends
yarn
&&
\
curl
-L
https://storage.googleapis.com/golang/go
${
GOVERSION
}
.linux-amd64.tar.gz
\
|
tar
-xz
-C
/usr/local
|
tar
-xz
-C
/usr/local
&&
\
git clone https://github.com/raspberrypi/tools.git /opt/rpi-tools
--depth
=
1
RUN
apt-get install
-y
\
gcc libc-dev make
&&
\
...
...
@@ -111,4 +112,4 @@ RUN apt-get install -y \
curl
-sSL
https://get.rvm.io | bash
-s
stable
&&
\
/bin/bash
-l
-c
"rvm requirements && rvm install 2.2 && gem install -N fpm"
ADD
./bootstrap.sh /tmp/bootstrap.sh
\ No newline at end of file
ADD
./bootstrap.sh /tmp/bootstrap.sh
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