forked from instana/openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
40 lines (32 loc) · 952 Bytes
/
Jenkinsfile
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
#!groovy
// define global vars for use in later stages
def gitCommitId = null
stage('Checkout') {
node {
deleteDir()
checkout scm
gitCommitId = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
currentBuild.displayName = "#${env.BUILD_NUMBER}:${env.VERSION}"
}
}
stage ('Generate and publish OpenAPI specs') {
node {
timeout(time: 10, unit: 'MINUTES') {
if (env.BRANCH_NAME == 'master') {
sh "./ci/publish.bash ${env.VERSION} ${env.BUILD_URL}"
}
}
}
}
stage ('Trigger API end-to-end tests') {
timeout(time: 30, unit: 'MINUTES') {
if (env.BRANCH_NAME == 'master') {
def versionParts = env.VERSION.tokenize('.')
def releaseNumber = versionParts[1]
build job: '/tests/rest-api-e2e-tests', parameters: [
string(name: 'BRANCH_NAME', value: "release-${releaseNumber}"),
string(name: 'ENVIRONMENT', value: 'preview-instana')
]
}
}
}