* MM-26584: Bump up Go patch version This contains a patch fix for https://github.com/golang/go/issues/38023 which have been encountered in our load tests and some users. I have verified on such a stuck instance and the thread dump seem to match with what is seen on the issue. All threads stuck on runtime.futex, except one, which is at runtime.osyield. And of all the times load tests were run which _did not_ show this issue, it was run with a version greater than 1.14.1, which further points to the theory that this bug is the culprit. * Replace docker image versions. * Update build/README.md Co-authored-by: Elisabeth Kulzer <elikul@elikul.de> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
170 строки
5.2 KiB
Groovy
170 строки
5.2 KiB
Groovy
#!/usr/bin/env groovy
|
|
|
|
@Library('shared-pipelines') _
|
|
import org.mattermost.Utils
|
|
import java.util.*;
|
|
def utils = new org.mattermost.Utils()
|
|
def build = new org.mattermost.BuildCommands()
|
|
def platformStages = new org.mattermost.PlatformStages()
|
|
|
|
def rndEE = UUID.randomUUID().toString()
|
|
def rndTE = UUID.randomUUID().toString()
|
|
def mmBuilderServer = 'mattermost/mattermost-build-server:20200731_golang-1.14.6'
|
|
def mmBuilderWebapp = 'mattermost/mattermost-build-webapp:oct-2-2018'
|
|
|
|
pipeline {
|
|
agent {
|
|
label 'default-mm-builder'
|
|
}
|
|
|
|
options {
|
|
buildDiscarder(logRotator(daysToKeepStr: '15'))
|
|
timeout(time: 2, unit: 'HOURS')
|
|
}
|
|
|
|
environment {
|
|
COMPOSE_PROJECT_NAME="${rnd}-${env.BUILD_NUMBER}"
|
|
GOPATH = "/go"
|
|
}
|
|
|
|
stages {
|
|
stage('Setup') {
|
|
steps {
|
|
script {
|
|
platformStages.platformEcho()
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Build') {
|
|
failFast true
|
|
parallel {
|
|
stage ('Build EE') {
|
|
agent {
|
|
label 'default-mm-builder'
|
|
}
|
|
steps {
|
|
script {
|
|
forcefullyCleanWorkspace(mmBuilderServer)
|
|
platformStages.platformCheckoutTE(env.BRANCH_NAME)
|
|
platformStages.platformCheckoutEE(env.BRANCH_NAME)
|
|
platformStages.platformCheckoutRedux(env.BRANCH_NAME)
|
|
SERVER_GIT_COMMIT=platformStages.platformServerCommitHash()
|
|
try {
|
|
platformStages.after5Dot20AddGOBINBuild(env.BRANCH_NAME + '.' + env.BUILD_NUMBER + '.' + SERVER_GIT_COMMIT, rndEE, false, mmBuilderServer, mmBuilderWebapp)
|
|
} finally {
|
|
platformStages.platformPublishResults()
|
|
platformStages.platformCleanDockerCompose(rndEE)
|
|
}
|
|
}
|
|
stash includes: 'src/github.com/mattermost/mattermost-server/dist/**', name: 'eedist'
|
|
}
|
|
}
|
|
stage ('Build TE') {
|
|
agent {
|
|
label 'default-mm-builder'
|
|
}
|
|
steps {
|
|
script {
|
|
forcefullyCleanWorkspace(mmBuilderServer)
|
|
platformStages.platformCheckoutTE(env.BRANCH_NAME)
|
|
platformStages.platformCheckoutRedux(env.BRANCH_NAME)
|
|
SERVER_GIT_COMMIT=platformStages.platformServerCommitHash()
|
|
try {
|
|
platformStages.after5Dot20AddGOBINBuild(env.BRANCH_NAME + '.' + env.BUILD_NUMBER + '.' + SERVER_GIT_COMMIT, rndTE, false, mmBuilderServer, mmBuilderWebapp)
|
|
} finally {
|
|
platformStages.platformPublishResults()
|
|
platformStages.platformCleanDockerCompose(rndTE)
|
|
}
|
|
}
|
|
stash includes: 'src/github.com/mattermost/mattermost-server/dist/**', name: 'tedist'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage ('Push EE') {
|
|
steps {
|
|
node('master') {
|
|
forcefullyCleanWorkspace(mmBuilderServer)
|
|
unstash 'eedist'
|
|
script {
|
|
platformStages.pushToS3('mattermost-platform/' + env.BRANCH_NAME, 'mattermost-enterprise-*',false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage ('Push TE') {
|
|
steps {
|
|
node('master') {
|
|
forcefullyCleanWorkspace(mmBuilderServer)
|
|
unstash 'tedist'
|
|
script {
|
|
platformStages.pushToS3('mattermost-platform/' + env.BRANCH_NAME, 'mattermost-team-*',false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage ('CleanCloudfront') {
|
|
steps {
|
|
node('master') {
|
|
script {
|
|
platformStages.cleanCloudfrontCache('mattermost-platform/' + env.BRANCH_NAME)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage ('Build Docker Images') {
|
|
agent {
|
|
label 'default-mm-builder'
|
|
}
|
|
steps {
|
|
script {
|
|
forcefullyCleanWorkspace(mmBuilderServer)
|
|
platformStages.platformCheckoutTE(env.BRANCH_NAME)
|
|
}
|
|
dir('src/github.com/mattermost/mattermost-server') {
|
|
withCredentials([usernamePassword(credentialsId: 'matterbuild-docker-hub', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
|
|
sh 'docker login --username ${DOCKER_USER} --password ${DOCKER_PASS}'
|
|
sh """
|
|
export TAG='${env.BRANCH_NAME}'
|
|
docker build --no-cache --build-arg MM_PACKAGE=https://releases.mattermost.com/mattermost-platform/${env.BRANCH_NAME}/mattermost-enterprise-linux-amd64.tar.gz -t mattermost/mattermost-enterprise-edition:\${TAG} build
|
|
docker push mattermost/mattermost-enterprise-edition:\${TAG}
|
|
"""
|
|
sh """
|
|
export TAG='${env.BRANCH_NAME}'
|
|
docker build --no-cache --build-arg MM_PACKAGE=https://releases.mattermost.com/mattermost-platform/${env.BRANCH_NAME}/mattermost-team-linux-amd64.tar.gz -t mattermost/mattermost-team-edition:\${TAG} build
|
|
docker push mattermost/mattermost-team-edition:\${TAG}
|
|
docker logout
|
|
"""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
cleanup {
|
|
forcefullyCleanWorkspace(mmBuilderServer)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
def forcefullyCleanWorkspace(String imageToUse) {
|
|
return withDockerContainer(
|
|
image: imageToUse,
|
|
args: '-u root'
|
|
) {
|
|
ansiColor('xterm') {
|
|
sh """#!/bin/bash -e
|
|
if [ -d "\$WORKSPACE" ]
|
|
then
|
|
rm -rfv \$WORKSPACE/*
|
|
fi
|
|
"""
|
|
}
|
|
}
|
|
}
|