mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #13031 from bergquist/golang_1.11
upgrade to golang 1.11
This commit is contained in:
commit
5d87aa2fa4
@ -19,7 +19,7 @@ version: 2
|
|||||||
jobs:
|
jobs:
|
||||||
mysql-integration-test:
|
mysql-integration-test:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/golang:1.10
|
- image: circleci/golang:1.11
|
||||||
- image: circleci/mysql:5.6-ram
|
- image: circleci/mysql:5.6-ram
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: rootpass
|
MYSQL_ROOT_PASSWORD: rootpass
|
||||||
@ -39,7 +39,7 @@ jobs:
|
|||||||
|
|
||||||
postgres-integration-test:
|
postgres-integration-test:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/golang:1.10
|
- image: circleci/golang:1.11
|
||||||
- image: circleci/postgres:9.3-ram
|
- image: circleci/postgres:9.3-ram
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: grafanatest
|
POSTGRES_USER: grafanatest
|
||||||
@ -74,7 +74,7 @@ jobs:
|
|||||||
|
|
||||||
gometalinter:
|
gometalinter:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/golang:1.10
|
- image: circleci/golang:1.11
|
||||||
environment:
|
environment:
|
||||||
# we need CGO because of go-sqlite3
|
# we need CGO because of go-sqlite3
|
||||||
CGO_ENABLED: 1
|
CGO_ENABLED: 1
|
||||||
@ -115,7 +115,7 @@ jobs:
|
|||||||
|
|
||||||
test-backend:
|
test-backend:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/golang:1.10
|
- image: circleci/golang:1.11
|
||||||
working_directory: /go/src/github.com/grafana/grafana
|
working_directory: /go/src/github.com/grafana/grafana
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@ -125,7 +125,7 @@ jobs:
|
|||||||
|
|
||||||
build-all:
|
build-all:
|
||||||
docker:
|
docker:
|
||||||
- image: grafana/build-container:1.0.0
|
- image: grafana/build-container:1.1.0
|
||||||
working_directory: /go/src/github.com/grafana/grafana
|
working_directory: /go/src/github.com/grafana/grafana
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@ -168,7 +168,7 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
docker:
|
docker:
|
||||||
- image: grafana/build-container:1.0.0
|
- image: grafana/build-container:1.1.0
|
||||||
working_directory: /go/src/github.com/grafana/grafana
|
working_directory: /go/src/github.com/grafana/grafana
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Golang build container
|
# Golang build container
|
||||||
FROM golang:1.10
|
FROM golang:1.11
|
||||||
|
|
||||||
WORKDIR $GOPATH/src/github.com/grafana/grafana
|
WORKDIR $GOPATH/src/github.com/grafana/grafana
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ the latest master builds [here](https://grafana.com/grafana/download)
|
|||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|
||||||
- Go 1.10
|
- Go 1.11
|
||||||
- NodeJS LTS
|
- NodeJS LTS
|
||||||
|
|
||||||
### Building the backend
|
### Building the backend
|
||||||
|
@ -7,7 +7,7 @@ clone_folder: c:\gopath\src\github.com\grafana\grafana
|
|||||||
environment:
|
environment:
|
||||||
nodejs_version: "6"
|
nodejs_version: "6"
|
||||||
GOPATH: C:\gopath
|
GOPATH: C:\gopath
|
||||||
GOVERSION: 1.10
|
GOVERSION: 1.11
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- rmdir c:\go /s /q
|
- rmdir c:\go /s /q
|
||||||
|
@ -13,7 +13,7 @@ dev environment. Grafana ships with its own required backend server; also comple
|
|||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
- [Go 1.10](https://golang.org/dl/)
|
- [Go 1.11](https://golang.org/dl/)
|
||||||
- [Git](https://git-scm.com/downloads)
|
- [Git](https://git-scm.com/downloads)
|
||||||
- [NodeJS LTS](https://nodejs.org/download/)
|
- [NodeJS LTS](https://nodejs.org/download/)
|
||||||
- node-gyp is the Node.js native addon build tool and it requires extra dependencies: python 2.7, make and GCC. These are already installed for most Linux distros and MacOS. See the Building On Windows section or the [node-gyp installation instructions](https://github.com/nodejs/node-gyp#installation) for more details.
|
- node-gyp is the Node.js native addon build tool and it requires extra dependencies: python 2.7, make and GCC. These are already installed for most Linux distros and MacOS. See the Building On Windows section or the [node-gyp installation instructions](https://github.com/nodejs/node-gyp#installation) for more details.
|
||||||
|
@ -70,7 +70,7 @@ func (c *connection) readPump() {
|
|||||||
func (c *connection) handleMessage(message []byte) {
|
func (c *connection) handleMessage(message []byte) {
|
||||||
json, err := simplejson.NewJson(message)
|
json, err := simplejson.NewJson(message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(3, "Unreadable message on websocket channel:", err)
|
log.Error(3, "Unreadable message on websocket channel. error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
msgType := json.Get("action").MustString()
|
msgType := json.Get("action").MustString()
|
||||||
|
@ -63,7 +63,7 @@ func ListAllPlugins(repoUrl string) (m.PluginRepo, error) {
|
|||||||
var data m.PluginRepo
|
var data m.PluginRepo
|
||||||
err = json.Unmarshal(body, &data)
|
err = json.Unmarshal(body, &data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Info("Failed to unmarshal graphite response error: %v", err)
|
logger.Info("Failed to unmarshal graphite response error:", err)
|
||||||
return m.PluginRepo{}, err
|
return m.PluginRepo{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ func GetPlugin(pluginId, repoUrl string) (m.Plugin, error) {
|
|||||||
var data m.Plugin
|
var data m.Plugin
|
||||||
err = json.Unmarshal(body, &data)
|
err = json.Unmarshal(body, &data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Info("Failed to unmarshal graphite response error: %v", err)
|
logger.Info("Failed to unmarshal graphite response error:", err)
|
||||||
return m.Plugin{}, err
|
return m.Plugin{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ func (u *S3Uploader) Upload(ctx context.Context, imageDiskPath string) (string,
|
|||||||
s3_endpoint, _ := endpoints.DefaultResolver().EndpointFor("s3", u.region)
|
s3_endpoint, _ := endpoints.DefaultResolver().EndpointFor("s3", u.region)
|
||||||
key := u.path + util.GetRandomString(20) + ".png"
|
key := u.path + util.GetRandomString(20) + ".png"
|
||||||
image_url := s3_endpoint.URL + "/" + u.bucket + "/" + key
|
image_url := s3_endpoint.URL + "/" + u.bucket + "/" + key
|
||||||
log.Debug("Uploading image to s3", "url = ", image_url)
|
log.Debug("Uploading image to s3. url = %s", image_url)
|
||||||
|
|
||||||
file, err := os.Open(imageDiskPath)
|
file, err := os.Open(imageDiskPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -105,7 +105,7 @@ func Critical(skip int, format string, v ...interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Fatal(skip int, format string, v ...interface{}) {
|
func Fatal(skip int, format string, v ...interface{}) {
|
||||||
Root.Crit(fmt.Sprintf(format, v))
|
Root.Crit(fmt.Sprintf(format, v...))
|
||||||
Close()
|
Close()
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ func UpsertUser(cmd *m.UpsertUserCommand) error {
|
|||||||
|
|
||||||
limitReached, err := quota.QuotaReached(cmd.ReqContext, "user")
|
limitReached, err := quota.QuotaReached(cmd.ReqContext, "user")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("Error getting user quota", "err", err)
|
log.Warn("Error getting user quota. error: %v", err)
|
||||||
return ErrGettingUserQuota
|
return ErrGettingUserQuota
|
||||||
}
|
}
|
||||||
if limitReached {
|
if limitReached {
|
||||||
@ -135,7 +135,7 @@ func updateUser(user *m.User, extUser *m.ExternalUserInfo) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debug("Syncing user info", "id", user.Id, "update", updateCmd)
|
log.Debug2("Syncing user info", "id", user.Id, "update", updateCmd)
|
||||||
return bus.Dispatch(updateCmd)
|
return bus.Dispatch(updateCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ func initContextWithAuthProxy(ctx *m.ReqContext, orgID int64) bool {
|
|||||||
|
|
||||||
// initialize session
|
// initialize session
|
||||||
if err := ctx.Session.Start(ctx.Context); err != nil {
|
if err := ctx.Session.Start(ctx.Context); err != nil {
|
||||||
log.Error(3, "Failed to start session", err)
|
log.Error(3, "Failed to start session. error %v", err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,12 +146,12 @@ func initContextWithAuthProxy(ctx *m.ReqContext, orgID int64) bool {
|
|||||||
if getRequestUserId(ctx) > 0 && getRequestUserId(ctx) != query.Result.UserId {
|
if getRequestUserId(ctx) > 0 && getRequestUserId(ctx) != query.Result.UserId {
|
||||||
// remove session
|
// remove session
|
||||||
if err := ctx.Session.Destory(ctx.Context); err != nil {
|
if err := ctx.Session.Destory(ctx.Context); err != nil {
|
||||||
log.Error(3, "Failed to destroy session, err")
|
log.Error(3, "Failed to destroy session. error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize a new session
|
// initialize a new session
|
||||||
if err := ctx.Session.Start(ctx.Context); err != nil {
|
if err := ctx.Session.Start(ctx.Context); err != nil {
|
||||||
log.Error(3, "Failed to start session", err)
|
log.Error(3, "Failed to start session. error: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ func appendIfPossible(message string, extra string, sizeLimit int) string {
|
|||||||
if len(extra)+len(message) <= sizeLimit {
|
if len(extra)+len(message) <= sizeLimit {
|
||||||
return message + extra
|
return message + extra
|
||||||
}
|
}
|
||||||
log.Debug("Line too long for image caption.", "value", extra)
|
log.Debug("Line too long for image caption. value: %s", extra)
|
||||||
return message
|
return message
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ func (ss *SqlStore) inTransactionWithRetryCtx(ctx context.Context, callback dbTr
|
|||||||
if len(sess.events) > 0 {
|
if len(sess.events) > 0 {
|
||||||
for _, e := range sess.events {
|
for _, e := range sess.events {
|
||||||
if err = bus.Publish(e); err != nil {
|
if err = bus.Publish(e); err != nil {
|
||||||
log.Error(3, "Failed to publish event after commit", err)
|
log.Error(3, "Failed to publish event after commit. error: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ func inTransactionWithRetryCtx(ctx context.Context, callback dbTransactionFunc,
|
|||||||
if len(sess.events) > 0 {
|
if len(sess.events) > 0 {
|
||||||
for _, e := range sess.events {
|
for _, e := range sess.events {
|
||||||
if err = bus.Publish(e); err != nil {
|
if err = bus.Publish(e); err != nil {
|
||||||
log.Error(3, "Failed to publish event after commit", err)
|
log.Error(3, "Failed to publish event after commit. error: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,7 @@ func getCommandLineProperties(args []string) map[string]string {
|
|||||||
trimmed := strings.TrimPrefix(arg, "cfg:")
|
trimmed := strings.TrimPrefix(arg, "cfg:")
|
||||||
parts := strings.Split(trimmed, "=")
|
parts := strings.Split(trimmed, "=")
|
||||||
if len(parts) != 2 {
|
if len(parts) != 2 {
|
||||||
log.Fatal(3, "Invalid command line argument", arg)
|
log.Fatal(3, "Invalid command line argument. argument: %v", arg)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A170311380
|
|||||||
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - && \
|
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - && \
|
||||||
yum install -y nodejs --nogpgcheck
|
yum install -y nodejs --nogpgcheck
|
||||||
|
|
||||||
ENV GOLANG_VERSION 1.10
|
ENV GOLANG_VERSION 1.11
|
||||||
|
|
||||||
RUN wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && \
|
RUN wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && \
|
||||||
yum install -y yarn --nogpgcheck && \
|
yum install -y yarn --nogpgcheck && \
|
||||||
|
@ -45,6 +45,10 @@ else
|
|||||||
fi
|
fi
|
||||||
echo "Building frontend"
|
echo "Building frontend"
|
||||||
go run build.go ${OPT} build-frontend
|
go run build.go ${OPT} build-frontend
|
||||||
|
|
||||||
|
# Load ruby, needed for packing with fpm
|
||||||
|
source /etc/profile.d/rvm.sh
|
||||||
|
|
||||||
echo "Packaging"
|
echo "Packaging"
|
||||||
go run build.go -goos linux -pkg-arch amd64 ${OPT} package-only latest
|
go run build.go -goos linux -pkg-arch amd64 ${OPT} package-only latest
|
||||||
#removing amd64 phantomjs bin for armv7/arm64 packages
|
#removing amd64 phantomjs bin for armv7/arm64 packages
|
||||||
|
@ -33,5 +33,8 @@ fi
|
|||||||
echo "Building frontend"
|
echo "Building frontend"
|
||||||
go run build.go ${OPT} build-frontend
|
go run build.go ${OPT} build-frontend
|
||||||
|
|
||||||
|
# Load ruby, needed for packing with fpm
|
||||||
|
source /etc/profile.d/rvm.sh
|
||||||
|
|
||||||
echo "Packaging"
|
echo "Packaging"
|
||||||
go run build.go -goos linux -pkg-arch amd64 ${OPT} package-only latest
|
go run build.go -goos linux -pkg-arch amd64 ${OPT} package-only latest
|
||||||
|
Loading…
Reference in New Issue
Block a user