update go to 1.12 (#10382)
* update go to 1.12 * update per feedback * fix test * revert test changes * remove zap.AddCallerSkip(1)
Этот коммит содержится в:
коммит произвёл
Jesse Hallam
родитель
7f9e1273d7
Коммит
6a3fdbd489
7
Makefile
7
Makefile
@@ -290,10 +290,13 @@ clean-docker: ## Deletes the docker containers for local development.
|
|||||||
|
|
||||||
govet: ## Runs govet against all packages.
|
govet: ## Runs govet against all packages.
|
||||||
@echo Running GOVET
|
@echo Running GOVET
|
||||||
$(GO) vet -shadow $(GOFLAGS) $(TE_PACKAGES) || exit 1
|
$(GO) get -u golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
|
||||||
|
$(GO) vet $(GOFLAGS) $(TE_PACKAGES) || exit 1
|
||||||
|
$(GO) vet -vettool=$(which shadow) $(GOFLAGS) $(TE_PACKAGES) || exit 1
|
||||||
|
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
$(GO) vet $(GOFLAGS) $(EE_PACKAGES) || exit 1
|
$(GO) vet $(GOFLAGS) $(TE_PACKAGES) || exit 1
|
||||||
|
$(GO) vet -vettool=$(which shadow) $(GOFLAGS) $(EE_PACKAGES) || exit 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
gofmt: ## Runs gofmt against all packages.
|
gofmt: ## Runs gofmt against all packages.
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
FROM golang:1.11
|
FROM golang:1.12
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y make git apt-transport-https ca-certificates curl software-properties-common build-essential zip wget xmlsec1
|
RUN apt-get update && apt-get install -y make git apt-transport-https ca-certificates curl software-properties-common build-essential zip wget xmlsec1
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
withDockerContainer(args: '-u root --privileged -v ${WORKSPACE}/src:/go/src/', image: 'mattermost/mattermost-build-server:dec-7-2018') {
|
withDockerContainer(args: '-u root --privileged -v ${WORKSPACE}/src:/go/src/', image: 'mattermost/mattermost-build-server:feb-28-2019') {
|
||||||
ansiColor('xterm') {
|
ansiColor('xterm') {
|
||||||
sh """
|
sh """
|
||||||
cd /go/src/github.com/mattermost/mattermost-server
|
cd /go/src/github.com/mattermost/mattermost-server
|
||||||
@@ -122,7 +122,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
withDockerContainer(args: "-u root --privileged --net ${COMPOSE_PROJECT_NAME}_mm-test -v ${WORKSPACE}/src:/go/src/", image: 'mattermost/mattermost-build-server:dec-7-2018') {
|
withDockerContainer(args: "-u root --privileged --net ${COMPOSE_PROJECT_NAME}_mm-test -v ${WORKSPACE}/src:/go/src/", image: 'mattermost/mattermost-build-server:feb-28-2019') {
|
||||||
ansiColor('xterm') {
|
ansiColor('xterm') {
|
||||||
sh """
|
sh """
|
||||||
cd /go/src/github.com/mattermost/mattermost-server
|
cd /go/src/github.com/mattermost/mattermost-server
|
||||||
|
|||||||
@@ -6,3 +6,14 @@ PRs opened against the `mattermost-server` repository will use the file called `
|
|||||||
|
|
||||||
The `Dockerfile` in this folder (`Dockerfile.buildenv`) is the build environment for our current builds you can find the docker image to downalod [here](https://hub.docker.com/r/mattermost/mattermost-build-server/tags/) or build your own.
|
The `Dockerfile` in this folder (`Dockerfile.buildenv`) is the build environment for our current builds you can find the docker image to downalod [here](https://hub.docker.com/r/mattermost/mattermost-build-server/tags/) or build your own.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Docker Image for building the Server
|
||||||
|
|
||||||
|
We have a docker image to build `mattermost-server` and it is based on Go docker image.
|
||||||
|
|
||||||
|
In our Docker Hub Repository we have the following images:
|
||||||
|
|
||||||
|
- `mattermost/mattermost-build-server:dec-7-2018` which is based on Go 1.11 you can use for MM versions <= `5.9.0`
|
||||||
|
- `mattermost/mattermost-build-server:feb-28-2019` which is based on Go 1.12
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ func TestLoggingAfterInitialized(t *testing.T) {
|
|||||||
|
|
||||||
actual = strings.Join(actualRows, "\n")
|
actual = strings.Join(actualRows, "\n")
|
||||||
}
|
}
|
||||||
require.Equal(t, testCase.ExpectedLogs, strings.Split(actual, "\n"))
|
require.ElementsMatch(t, testCase.ExpectedLogs, strings.Split(actual, "\n"))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ func NewLogger(config *LoggerConfiguration) *Logger {
|
|||||||
combinedCore := zapcore.NewTee(cores...)
|
combinedCore := zapcore.NewTee(cores...)
|
||||||
|
|
||||||
logger.zap = zap.New(combinedCore,
|
logger.zap = zap.New(combinedCore,
|
||||||
zap.AddCallerSkip(1),
|
|
||||||
zap.AddCaller(),
|
zap.AddCaller(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ func NewTestingLogger(tb testing.TB) *Logger {
|
|||||||
logWriterCore := zapcore.NewCore(makeEncoder(true), logWriterSync, testingLogger.consoleLevel)
|
logWriterCore := zapcore.NewCore(makeEncoder(true), logWriterSync, testingLogger.consoleLevel)
|
||||||
|
|
||||||
testingLogger.zap = zap.New(logWriterCore,
|
testingLogger.zap = zap.New(logWriterCore,
|
||||||
zap.AddCallerSkip(1),
|
|
||||||
zap.AddCaller(),
|
zap.AddCaller(),
|
||||||
)
|
)
|
||||||
return testingLogger
|
return testingLogger
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ echo "Checking prerequisites"
|
|||||||
|
|
||||||
REQUIREDNODEVERSION=8.9.0
|
REQUIREDNODEVERSION=8.9.0
|
||||||
REQUIREDNPMVERSION=5.6.0
|
REQUIREDNPMVERSION=5.6.0
|
||||||
REQUIREDGOVERSION=1.11.0
|
REQUIREDGOVERSION=1.12.0
|
||||||
REQUIREDDOCKERVERSION=17.0
|
REQUIREDDOCKERVERSION=17.0
|
||||||
|
|
||||||
NODEVERSION=$(sed 's/v//' <<< $(node -v))
|
NODEVERSION=$(sed 's/v//' <<< $(node -v))
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user