forked from opensearch-project/opensearch-build-libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
standardReleasePipeline.groovy
47 lines (45 loc) · 1.38 KB
/
standardReleasePipeline.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
/** A standard release pipeline for OpenSearch projects
@param Map args = [:] args A map of the following parameters
@param body <Required> - A closure containing release steps to be executed in release stage.
@param args.overrideAgent <Optional> - Jenkins agent label to override the default.
@param args.overrideDockerImage <Optional> - Docker image to override the default.
*/
void call(Map args = [:], Closure body) {
pipeline {
agent
{
docker {
label args.overrideAgent ?: 'Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host'
image args.overrideDockerImage ?: 'opensearchstaging/ci-runner:release-centos7-clients-v4'
alwaysPull true
}
}
options {
timeout(time: 1, unit: 'HOURS')
}
stages{
stage("Release") {
steps {
script {
body()
}
}
}
}
post {
always {
script {
postCleanup()
}
}
}
}
}