| Another case that does not make any sense that it said that the method is too large, the following pipeline return the "Method code too large!" error
pipeline {
agent { label 'ubuntu && immutable' }
environment {
BASE_DIR = 'src/github.com/elastic/beats'
JOB_GCS_BUCKET = 'beats-ci-artifacts'
JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin'
DOCKERELASTIC_SECRET = 'secret/observability-team/ci/docker-registry/prod'
DOCKER_REGISTRY = 'docker.elastic.co'
SNAPSHOT = "true"
}
options {
timeout(time: 3, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
disableConcurrentBuilds()
}
triggers {
issueCommentTrigger('(?i)^\\/packaging$')
}
parameters {
booleanParam(name: 'macos', defaultValue: false, description: 'Allow macOS stages.')
booleanParam(name: 'linux', defaultValue: true, description: 'Allow linux stages.')
}
stages {
stage('Checkout') {
options { skipDefaultCheckout() }
steps {
deleteDir()
gitCheckout(basedir: "${BASE_DIR}")
setEnvVar("GO_VERSION", readFile("${BASE_DIR}/.go-version").trim())
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
}
}
stage('Build Packages'){
matrix {
agent { label 'ubuntu && immutable' }
axes {
axis {
name 'PLATFORMS'
values (
'+linux/armv7',
'+linux/ppc64le',
'+linux/s390x',
'+linux/mips64',
'+darwin',
'+windows/386',
'+windows/amd64'
)
}
axis {
name 'BEATS_FOLDER'
values (
'auditbeat',
'filebeat',
'heartbeat',
'journalbeat',
'metricbeat',
'packetbeat',
'winlogbeat',
'x-pack/auditbeat',
'x-pack/filebeat',
'x-pack/functionbeat',
'x-pack/heartbeat',
'x-pack/journalbeat',
'x-pack/metricbeat',
'x-pack/packetbeat',
'x-pack/winlogbeat'
)
}
}
stages {
stage('Package'){
options { skipDefaultCheckout() }
environment {
HOME = "${env.WORKSPACE}"
}
steps {
echo "Running tests"
}
}
}
}
}
}
}
moving the agent request from the matrix to the stage resolves the issue, but it should be supported
pipeline {
agent { label 'ubuntu && immutable' }
environment {
BASE_DIR = 'src/github.com/elastic/beats'
JOB_GCS_BUCKET = 'beats-ci-artifacts'
JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin'
DOCKERELASTIC_SECRET = 'secret/observability-team/ci/docker-registry/prod'
DOCKER_REGISTRY = 'docker.elastic.co'
SNAPSHOT = "true"
}
options {
timeout(time: 3, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
disableConcurrentBuilds()
}
triggers {
issueCommentTrigger('(?i)^\\/packaging$')
}
parameters {
booleanParam(name: 'macos', defaultValue: false, description: 'Allow macOS stages.')
booleanParam(name: 'linux', defaultValue: true, description: 'Allow linux stages.')
}
stages {
stage('Checkout') {
options { skipDefaultCheckout() }
steps {
deleteDir()
gitCheckout(basedir: "${BASE_DIR}")
setEnvVar("GO_VERSION", readFile("${BASE_DIR}/.go-version").trim())
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
}
}
stage('Build Packages'){
matrix {
axes {
axis {
name 'PLATFORMS'
values (
'+linux/armv7',
'+linux/ppc64le',
'+linux/s390x',
'+linux/mips64',
'+darwin',
'+windows/386',
'+windows/amd64'
)
}
axis {
name 'BEATS_FOLDER'
values (
'auditbeat',
'filebeat',
'heartbeat',
'journalbeat',
'metricbeat',
'packetbeat',
'winlogbeat',
'x-pack/auditbeat',
'x-pack/filebeat',
'x-pack/functionbeat',
'x-pack/heartbeat',
'x-pack/journalbeat',
'x-pack/metricbeat',
'x-pack/packetbeat',
'x-pack/winlogbeat'
)
}
}
stages {
stage('Package'){
agent { label 'ubuntu && immutable' }
options { skipDefaultCheckout() }
environment {
HOME = "${env.WORKSPACE}"
}
steps {
deleteDir()
unstash 'source'
release()
publishPackages()
}
}
}
}
}
}
}
|