Skip to content

Commit bddb81d

Browse files
authored
ci(jenkins): reuse agents (4 less agents to be used) (#606)
1 parent f7bac0e commit bddb81d

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

.ci/Jenkinsfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import co.elastic.matrix.*
55

66
pipeline {
7-
agent any
7+
agent { label 'linux && immutable' }
88
environment {
99
BASE_DIR="src/github.com/elastic/apm-agent-python"
1010
PIPELINE_LOG_LEVEL='INFO'
@@ -26,7 +26,6 @@ pipeline {
2626
}
2727
stages {
2828
stage('Initializing'){
29-
agent { label 'docker && linux && immutable' }
3029
options { skipDefaultCheckout() }
3130
environment {
3231
HOME = "${env.WORKSPACE}"
@@ -73,7 +72,6 @@ pipeline {
7372
Execute unit tests.
7473
*/
7574
stage('Test') {
76-
agent { label 'linux && immutable' }
7775
options {
7876
timeout(time: 1, unit: 'HOURS')
7977
skipDefaultCheckout()
@@ -96,7 +94,6 @@ pipeline {
9694
}
9795
}
9896
stage('Building packages') {
99-
agent { label 'docker && linux && immutable' }
10097
options {
10198
timeout(time: 1, unit: 'HOURS')
10299
skipDefaultCheckout()
@@ -119,7 +116,6 @@ pipeline {
119116
}
120117
}
121118
stage('Release') {
122-
agent { label 'linux && immutable' }
123119
options {
124120
skipDefaultCheckout()
125121
timeout(time: 12, unit: 'HOURS')

.ci/downstreamTests.groovy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ it is need as field to store the results of the tests.
1111
@Field def pythonTasksGen
1212

1313
pipeline {
14-
agent any
14+
agent { label 'linux && immutable' }
1515
environment {
1616
REPO="[email protected]:elastic/apm-agent-python.git"
1717
BASE_DIR="src/github.com/elastic/apm-agent-python"
@@ -41,7 +41,6 @@ pipeline {
4141
Checkout the code and stash it, to use it on other stages.
4242
*/
4343
stage('Checkout') {
44-
agent { label 'docker && linux && immutable' }
4544
options { skipDefaultCheckout() }
4645
steps {
4746
script {
@@ -64,7 +63,6 @@ pipeline {
6463
Execute unit tests.
6564
*/
6665
stage('Test') {
67-
agent { label 'linux && immutable' }
6866
options { skipDefaultCheckout() }
6967
steps {
7068
deleteDir()

.ci/linting.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@Library('apm@current') _
33

44
pipeline {
5-
agent any
5+
agent { label 'linux && immutable' }
66
options {
77
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
88
timestamps()
@@ -17,7 +17,6 @@ pipeline {
1717
}
1818
stages {
1919
stage('Sanity checks') {
20-
agent { label 'docker && linux && immutable' }
2120
environment {
2221
HOME = "${env.WORKSPACE}"
2322
PATH = "${env.PATH}:${env.WORKSPACE}/bin"

Jenkinsfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ it is need as field to store the results of the tests.
1111
@Field def pythonTasksGen
1212

1313
pipeline {
14-
agent any
14+
agent { label 'linux && immutable' }
1515
environment {
1616
REPO = 'apm-agent-python'
1717
BASE_DIR = "src/github.com/elastic/${env.REPO}"
@@ -40,7 +40,6 @@ pipeline {
4040
}
4141
stages {
4242
stage('Initializing'){
43-
agent { label 'docker && linux && immutable' }
4443
options { skipDefaultCheckout() }
4544
environment {
4645
HOME = "${env.WORKSPACE}"
@@ -87,7 +86,6 @@ pipeline {
8786
Execute unit tests.
8887
*/
8988
stage('Test') {
90-
agent { label 'linux && immutable' }
9189
options { skipDefaultCheckout() }
9290
steps {
9391
withGithubNotify(context: 'Test', tab: 'tests') {
@@ -113,7 +111,6 @@ pipeline {
113111
}
114112
}
115113
stage('Building packages') {
116-
agent { label 'docker && linux && immutable' }
117114
options { skipDefaultCheckout() }
118115
environment {
119116
HOME = "${env.WORKSPACE}"
@@ -155,7 +152,6 @@ pipeline {
155152
}
156153
}
157154
stage('Release') {
158-
agent { label 'linux && immutable' }
159155
options { skipDefaultCheckout() }
160156
environment {
161157
HOME = "${env.WORKSPACE}"

0 commit comments

Comments
 (0)