Commit Graph

126 Commits

Author SHA1 Message Date
Kyle Brandt
6d500e31b9
Backend: Remove Go vendor folder (#23796) 2020-04-23 13:23:51 -04:00
Marcus Efraimsson
6e313e7d37
Image Rendering: Remove PhantomJS support (#23460)
Removes all references and usage of PhantomJS #23375.
Remove direct link rendered image e2e smoke test for now.
Docker: Fix installing chrome in ubuntu custom docker image.
Improve handling of image renderer not available/installed #23593.
Add PhantomJS breaking change and upgrading notes.
Use grabpl v0.2.10.

Closes #13802

Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-04-15 22:17:41 +02:00
Arve Knudsen
b3c00e4c32
Docker: Build and use musl-based binaries in alpine images to resolve glibc incompatibility issues (#19798)
* build: Install musl cross compilers as part of build Docker image
* build: Build also musl packages in scripts/build/build.sh
* scripts/build/build-all.sh: Build musl Linux targets
* build: Upgrade build-container to 1.2.11
* build.go: De-duplicate code
* build: Base Docker images on musl binaries
2019-10-24 14:34:14 +02:00
Kyle Brandt
29a04ad69c build: use vendor folder for building (#19677)
* build: use vendor folder for building
not sure if this is a good idea or not, but this stops module fetching

* untouch yarn.lock

Signed-off-by: Kyle Brandt <kyle@grafana.com>

* modules on in runPrint
2019-10-08 10:17:31 +02:00
Arve Knudsen
fc2282009e
Build: Fix building when $LDFLAGS is set (#19509)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2019-10-01 09:31:25 +02:00
jelle van der Waa
5affb919f2 Build: Allow extending of LDFLAGS in build.go (#18954)
Allow extending LDFALGS by setting LDFLAGS to be able to pass
-zrelro,-znow for Arch Linux packaging
to get full relro.
2019-09-09 07:49:24 +02:00
jelle van der Waa
ce7a8dde83 Build: Support SOURCE_DATE_EPOCH for reproducible builds (#18953)
If grafana is build from a non-git source a new timestamp is used every build which makes grafana binaries
non-reproducible.

Motivation: https://reproducible-builds.org
2019-09-09 07:30:48 +02:00
gotjosh
2fb45eeec8
Grafana-CLI: Wrapper for grafana-cli within RPM/DEB packages and config/homepath are now global flags (#17695)
* Feature: Introduce a grafana-cli wrapper

When our users install the *nix packed version of grafana, tendency is to use the services and scripts installed as part of the package for grafana-server. These leverage the default configuration options by specifying the several default paths.

This introduces a similar approach for the grafana-cli binary. We exposed it through a wrapper to ensure a proper configuration is in place. To enable that, we add the .real suffix to the original binary (grafana-cli.real) and then use a bash script named grafana-cli as the wrapper.

* Make the config and homepath flags global

* Introduce `configOverrides` as a global flag

This flag allows us to pass configuration overrides as a string.

The string follows the convention of configuration arguments separated by a space e.g. "cfg:default.paths.data=/dev/nullX cfg:default.paths.logs=/dev/nullX"

Also, it is backwards compatible with similar the previous configuration method through tailing arguments. Tailing arguments take presedence over the configuration options string.

* Only log configuration information in debug mode

* Move the grafana-cli binary to $GRAFANA_HOME/bin

As part of the package install process, we copy all the release files and
directories into the grafana home directory. This includes the /bin folder
from where we copied the binaries into their respective destinations.
After that, the /bin folder gets deleted as we don't want to keep
duplicates of the binaries around.

As part of this commit, we moved the re-creation of /bin within
grafana-home and the copy of the original binary (again) after the
folder gets deleted.
2019-06-24 20:20:21 +01:00
Carl Bergquist
68f5ddf18c
replace dep with go modules (#16017)
- guide shamelessly stolen from prometheus/prometheus
- updates local interface of oauth exchange
- updates local impl of hclogger
- bump jaeger client version

closes #16088
2019-04-16 12:00:55 +02:00
Dennis Hoppe
15383510c8 Use package libfontconfig1, instead of libfontconfig (#16548) 2019-04-15 08:20:42 +02:00
Leonard Gram
b48c18a1c5 build: Fix for renamed package for armv6. 2019-04-02 13:37:57 +02:00
Leonard Gram
f0c6a480cd build: refactoring 2019-03-25 09:48:45 +01:00
Leonard Gram
6e802dc94d build: builds armv6 with rpi1 compat gcc. 2019-03-25 09:48:45 +01:00
Leonard Gram
2bdc147e55 build: skips building rpm for armv6. 2019-01-22 11:09:27 +01:00
Leonard Gram
5f188058e3 build: builds for armv6. 2019-01-22 11:09:27 +01:00
Johannes Würbach
702d449001 Docker image for ARM 2019-01-10 14:41:02 +01:00
Leonard Gram
13a962cc50 Revert "Docker image for ARM"
This reverts commit 5f7e6a5c73.
2019-01-09 16:25:07 +01:00
Johannes Würbach
5f7e6a5c73 Docker image for ARM 2019-01-09 15:09:13 +01:00
Leonard Gram
2e8c4699b0 build: internal metrics for packaging. 2018-11-15 14:42:09 +01:00
Mario Trangoni
8c04926326 Fix gofmt issues
See,
$ gometalinter --disable-all --enable=gofmt --deadline 10m --vendor ./...
build.go:1:⚠️ file is not gofmted with -s (gofmt)
scripts/build/release_publisher/externalrelease.go:1:⚠️ file is not gofmted with -s (gofmt)
scripts/build/release_publisher/localrelease.go:1:⚠️ file is not gofmted with -s (gofmt)
scripts/build/release_publisher/main.go:1:⚠️ file is not gofmted with -s (gofmt)
scripts/build/release_publisher/publisher_test.go:1:⚠️ file is not gofmted with -s (gofmt)
2018-11-12 10:47:27 +01:00
Leonard Gram
a1dca2117d
build: use build workflow id instead of build number. (#13965)
* build: use build workflow id instead of build number.

The workflow id is unique across the whole workflow
while the build number is unique to every job in the
workflow. This change means that jobs that build
artifacts for the same commit but in different jobs
will now have the same id.

* build: fixes pkgver generation.
2018-11-05 15:05:12 +01:00
bergquist
c9ac762fb1 build: adds branch info to binary build 2018-10-29 13:27:29 +01:00
Leonard Gram
30cb28df55
build: correctly adds enterprise to the filename. (#13831) 2018-10-25 16:55:27 +02:00
Mario Trangoni
0870464ea5 Fix goconst issues
See,
$ gometalinter --vendor --disable-all --enable=goconst --disable=gotype --deadline=6m ./...
build.go:113:15⚠️ 2 other occurrence(s) of "linux" found in: build.go:119:15 build.go:491:34 (goconst)
build.go:119:15⚠️ 2 other occurrence(s) of "linux" found in: build.go:113:15 build.go:491:34 (goconst)
build.go:491:34⚠️ 2 other occurrence(s) of "linux" found in: build.go:113:15 build.go:119:15 (goconst)
build.go:381:21⚠️ 2 other occurrence(s) of "windows" found in: build.go:423:13 build.go:487:13 (goconst)
build.go:423:13⚠️ 2 other occurrence(s) of "windows" found in: build.go:381:21 build.go:487:13 (goconst)
build.go:487:13⚠️ 2 other occurrence(s) of "windows" found in: build.go:381:21 build.go:423:13 (goconst)
pkg/api/dashboard.go:67:22⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:131:10 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:22 pkg/api/folder.go:98:35 (goconst)
pkg/api/dashboard.go:67:35⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:131:10 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:22 pkg/api/folder.go:98:35 (goconst)
pkg/api/dashboard.go:131:10⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:22 pkg/api/folder.go:98:35 (goconst)
pkg/api/dashboard.go:406:13⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:131:10 pkg/api/folder.go:98:22 pkg/api/folder.go:98:35 (goconst)
pkg/api/folder.go:98:22⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:131:10 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:35 (goconst)
pkg/api/folder.go:98:35⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:131:10 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:22 (goconst)
pkg/api/index.go:63:47⚠️ 2 other occurrence(s) of "light" found
in: pkg/api/index.go:91:22 pkg/api/index.go:93:16 (goconst)
pkg/api/index.go:91:22⚠️ 2 other occurrence(s) of "light" found in: pkg/api/index.go:63:47 pkg/api/index.go:93:16 (goconst)
pkg/api/index.go:93:16⚠️ 2 other occurrence(s) of "light" found in: pkg/api/index.go:63:47 pkg/api/index.go:91:22 (goconst)
pkg/components/null/float.go:71:25⚠️ 2 other occurrence(s) of "null" found in: pkg/components/null/float.go:103:10 pkg/components/null/float.go:112:10 (goconst)
pkg/components/null/float.go:103:10⚠️ 2 other occurrence(s) of "null" found in: pkg/components/null/float.go:71:25 pkg/components/null/float.go:112:10 (goconst)
pkg/components/null/float.go:112:10⚠️ 2 other occurrence(s) of "null" found in: pkg/components/null/float.go:71:25 pkg/components/null/float.go:103:10 (goconst)
pkg/services/alerting/notifiers/pagerduty.go:79:16⚠️ 2 other occurrence(s) of "Triggered metrics:\n\n" found in: pkg/services/alerting/notifiers/kafka.go:64:16 pkg/services/alerting/notifiers/opsgenie.go:98:16 (goconst)
pkg/services/alerting/notifiers/kafka.go:64:16⚠️ 2 other occurrence(s) of "Triggered metrics:\n\n" found in: pkg/services/alerting/notifiers/pagerduty.go:79:16 pkg/services/alerting/notifiers/opsgenie.go:98:16 (goconst)
pkg/services/alerting/notifiers/opsgenie.go:98:16⚠️ 2 other occurrence(s) of "Triggered metrics:\n\n" found in: pkg/services/alerting/notifiers/pagerduty.go:79:16 pkg/services/alerting/notifiers/kafka.go:64:16 (goconst)
pkg/social/social.go:85:11⚠️ 2 other occurrence(s) of "grafana_com" found in: pkg/social/social.go:162:14 pkg/social/social.go:197:11 (goconst)
pkg/social/social.go:162:14⚠️ 2 other occurrence(s) of "grafana_com" found in: pkg/social/social.go:85:11 pkg/social/social.go:197:11 (goconst)
pkg/social/social.go:197:11⚠️ 2 other occurrence(s) of "grafana_com" found in: pkg/social/social.go:85:11 pkg/social/social.go:162:14 (goconst)
pkg/tsdb/elasticsearch/time_series_query.go:92:17⚠️ 3 other occurrence(s) of "count" found in: pkg/tsdb/elasticsearch/response_parser.go:152:8 pkg/tsdb/elasticsearch/response_parser.go:167:31 pkg/tsdb/elasticsearch/response_parser.go:315:9 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:152:8⚠️ 3 other occurrence(s) of "count" found in: pkg/tsdb/elasticsearch/time_series_query.go:92:17 pkg/tsdb/elasticsearch/response_parser.go:167:31 pkg/tsdb/elasticsearch/response_parser.go:315:9 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:167:31⚠️ 3 other occurrence(s) of "count" found in: pkg/tsdb/elasticsearch/time_series_query.go:92:17 pkg/tsdb/elasticsearch/response_parser.go:152:8 pkg/tsdb/elasticsearch/response_parser.go:315:9 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:315:9⚠️ 3 other occurrence(s) of "count" found in: pkg/tsdb/elasticsearch/time_series_query.go:92:17 pkg/tsdb/elasticsearch/response_parser.go:152:8 pkg/tsdb/elasticsearch/response_parser.go:167:31 (goconst)
pkg/tsdb/elasticsearch/time_series_query.go:78:9⚠️ 2 other occurrence(s) of "date_histogram" found in: pkg/tsdb/elasticsearch/response_parser.go:84:22 pkg/tsdb/elasticsearch/response_parser.go:369:24 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:84:22⚠️ 2 other occurrence(s) of "date_histogram" found in: pkg/tsdb/elasticsearch/time_series_query.go:78:9 pkg/tsdb/elasticsearch/response_parser.go:369:24 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:369:24⚠️ 2 other occurrence(s) of "date_histogram" found in: pkg/tsdb/elasticsearch/time_series_query.go:78:9 pkg/tsdb/elasticsearch/response_parser.go:84:22 (goconst)
2018-09-23 21:19:21 +02:00
Mario Trangoni
80fa66fcb0 Fix some typos found by codespell
See,
$ codespell -S "./.git*,./vendor*,./public*"
2018-09-21 11:54:52 +02:00
Leonard Gram
5bb0d26604 build: fixes rpm build when using defaults.
Closes #12980
2018-08-24 15:23:49 +02:00
Torkel Ödegaard
ce64a3ccbc added: replaces added to grafana 2018-07-18 15:40:30 +02:00
Torkel Ödegaard
6286c31d4b refactoring: making api wrap public 2018-07-02 14:13:18 +02:00
bergquist
a2ed0b15da build: fixes broken path for bra run
removes os and arch from binary path
when building in dev mode
2018-05-28 10:39:42 +02:00
fg2it
22638db532 fix names of foreign arch packages 2018-05-23 23:53:59 +02:00
Leonard Gram
9123e0fca8 build: crossplatform build with packages.
Big thanks to @fg2it who created a POC as
well as the build container that this work
is based on.
2018-05-18 14:38:04 +02:00
Carl Bergquist
28f7b6dad1 Enable Grafana extensions at build time. (#11752)
* extensions: import and build

* bus: use predefined error

* enterprise: build script for enterprise packages

* poc: auto registering services and dependency injection

(cherry picked from commit b5b1ef875f905473af41e49f8071cb9028edc845)

* poc: backend services registry progress

(cherry picked from commit 97be69725881241bfbf1e7adf0e66801d6b0af3d)

* poc: minor update

(cherry picked from commit 03d7a6888b81403f458b94305792e075568f0794)

* ioc: introduce manuel ioc

* enterprise: adds setting for enterprise

* build: test and build specific ee commit

* cleanup: test testing code

* removes example hello service
2018-04-27 13:41:58 +02:00
bergquist
8e9b3507c5 tech: removes unused code 2018-04-27 10:39:06 +02:00
Mario Trangoni
7aaa188471 build.go: fix deadcode issues 2018-04-26 19:04:07 +02:00
Marcus Efraimsson
b7b0ca2b90
build: introduce -dev flag optimal for building in development mode
Fix performance issue with running bra run for go run build.go build
2018-04-18 11:25:34 +02:00
Karsten Weiss
f61e69ce75 Simplify comparison to bool constant (gosimple)
This fixes:
build.go:553:6: should omit comparison to bool constant, can be simplified to !strings.Contains(path, ".sha256") (S1002)
pkg/cmd/grafana-cli/commands/ls_command.go:27:5: should omit comparison to bool constant, can be simplified to !pluginDirInfo.IsDir() (S1002)
pkg/components/dynmap/dynmap_test.go:24:5: should omit comparison to bool constant, can be simplified to !value (S1002)
pkg/components/dynmap/dynmap_test.go:122:14: should omit comparison to bool constant, can be simplified to b (S1002)
pkg/components/dynmap/dynmap_test.go:125:14: should omit comparison to bool constant, can be simplified to !b (S1002)
pkg/components/dynmap/dynmap_test.go:128:14: should omit comparison to bool constant, can be simplified to !b (S1002)
pkg/models/org_user.go:51:5: should omit comparison to bool constant, can be simplified to !(*r).IsValid() (S1002)
pkg/plugins/datasource/wrapper/datasource_plugin_wrapper_test.go:77:12: should omit comparison to bool constant, can be simplified to !haveBool (S1002)
pkg/services/alerting/conditions/evaluator.go:23:9: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/evaluator.go:48:5: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/evaluator.go:91:5: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/query.go:56:6: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/extractor.go:107:20: should omit comparison to bool constant, can be simplified to !enabled.MustBool() (S1002)
pkg/services/alerting/notifiers/telegram.go:222:41: should omit comparison to bool constant, can be simplified to this.UploadImage (S1002)
pkg/services/sqlstore/apikey.go:58:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/apikey.go:72:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:66:33: should omit comparison to bool constant, can be simplified to !cmd.Overwrite (S1002)
pkg/services/sqlstore/dashboard.go:175:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:311:13: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:444:12: should omit comparison to bool constant, can be simplified to !exists (S1002)
pkg/services/sqlstore/dashboard.go:472:12: should omit comparison to bool constant, can be simplified to !exists (S1002)
pkg/services/sqlstore/dashboard.go:554:32: should omit comparison to bool constant, can be simplified to !cmd.Overwrite (S1002)
pkg/services/sqlstore/dashboard_snapshot.go:83:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/plugin_setting.go:39:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:34:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:111:6: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:136:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:213:6: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/temp_user.go:129:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:157:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:182:5: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:191:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:212:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:307:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/social/generic_oauth.go:185:5: should omit comparison to bool constant, can be simplified to !s.extractToken(&data, token) (S1002)
pkg/tsdb/mssql/mssql.go:148:39: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mssql/mssql.go:212:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/mssql/mssql.go:247:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mssql/mssql.go:274:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mssql/mssql.go:282:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mysql/mysql.go:221:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/mysql/mysql.go:256:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mysql/mysql.go:283:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mysql/mysql.go:291:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/postgres/postgres.go:134:39: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/postgres/postgres.go:201:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/postgres/postgres.go:236:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/postgres/postgres.go:263:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/postgres/postgres.go:271:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
2018-04-16 21:04:57 +02:00
Marcus Efraimsson
d4beee2bb0 Merge branch 'master' into mssql_datasource 2018-03-13 16:03:02 +01:00
Dan Cech
338655dd37
move Context and session out of middleware 2018-03-06 18:16:49 -05:00
bergquist
278337e45a install dep instead of govendor on setup 2018-01-19 10:27:02 +01:00
Ali
de22e793d8
Merge branch 'master' into master 2018-01-03 10:33:54 +03:00
linux chips
cc00327fbe add server only build target "build-srv" 2017-12-02 13:22:51 +03:00
Daniel Lee
e6bf266c4b formatting in build file 2017-11-29 11:15:27 +01:00
Daniel Lee
91ad260517 build: on windows, ignore linux packaging 2017-06-28 09:35:33 +02:00
Torkel Ödegaard
1e3a42ca68 packaging: added rpm fonts to rpm package dependencies (#8442) 2017-05-23 13:53:03 +02:00
Torkel Ödegaard
7864828e75 packaging: publish nightly builds 2017-03-23 11:10:01 +01:00
Daniel Lee
69bec98962 chore: update all grafana.org urls to .com 2017-03-21 15:37:55 +01:00
Torkel Ödegaard
99064603a4 packaging: added rpm posttrans script to fix config file change, fixes #7686 2017-03-21 10:36:15 +01:00
bergquist
06146b801c build: replace sha1 files with sha256
due to security reasons.
https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html
2017-03-01 11:44:53 +01:00
bergquist
3ef077c180 build: use correct version for tar.gz files 2017-02-28 09:09:49 +01:00
bergquist
79daa71350 docs: update golang requirement to 1.8 2017-02-17 10:37:59 +01:00