-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.integration
66 lines (60 loc) · 2.13 KB
/
Jenkinsfile.integration
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
library(
identifier: 'jenkins-shared-library@master',
retriever: modernSCM(
[
$class: 'GitSCMSource',
remote: 'https://github.com/dhanarab/jenkins-pipeline-library.git'
]
)
)
bitbucketCredentialsHttps = "bitbucket-build-extend-https"
bitbucketCredentialsSsh = "bitbucket-build-extend-ssh"
bitbucketCommitHref = null
jobChannel = env.SLACK_CHANNEL_ACTIVITY_EXTEND_CODEGEN_SDK ? env.SLACK_CHANNEL_ACTIVITY_EXTEND_CODEGEN_SDK : "#activity-justice-codegen-sdk"
pipeline {
agent {
label "extend-builder-batch"
}
stages {
stage('Prepare') {
steps {
script {
gitRepositoryName = git.getRepositoryName()
gitCommitHash = git.getCommitHash()
bitbucketCommitHref = "https://api.bitbucket.org/2.0/repositories/accelbyte/${gitRepositoryName}/commit/${gitCommitHash}"
bitbucket.setBuildStatus(bitbucketCredentialsHttps, bitbucketCommitHref, "INPROGRESS", env.JOB_NAME, "${env.JOB_NAME}-${env.BUILD_NUMBER}", "Jenkins", "${env.BUILD_URL}console")
}
}
}
stage('Test') {
stages {
stage('Integration Tests') {
options {
lock("justice-demo-serversdktest")
}
steps {
withCredentials([file(credentialsId: 'justice-codegen-sdk-integration-test-env', variable: 'ENV_FILE_PATH')]) {
sh 'make test_integration ENV_FILE_PATH="$ENV_FILE_PATH"'
}
}
}
}
}
}
post {
success {
script {
bitbucket.setBuildStatus(bitbucketCredentialsHttps, bitbucketCommitHref, "SUCCESSFUL", env.JOB_NAME, "${env.JOB_NAME}-${env.BUILD_NUMBER}", "Jenkins", "${env.BUILD_URL}console")
}
}
failure {
script {
bitbucket.setBuildStatus(bitbucketCredentialsHttps, bitbucketCommitHref, "FAILED", env.JOB_NAME, "${env.JOB_NAME}-${env.BUILD_NUMBER}", "Jenkins", "${env.BUILD_URL}console")
message = """
:no_entry: <${env.BUILD_URL}|${env.JOB_NAME}-${env.BUILD_NUMBER}> *failed*
|""".stripMargin()
slackSend(channel: jobChannel, color: '#FF0000', message: message)
}
}
}
}