-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile.nightly-starter
81 lines (74 loc) · 2.78 KB
/
Jenkinsfile.nightly-starter
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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-starter-serversdktest")
}
steps {
withCredentials([file(credentialsId: 'justice-codegen-sdk-integration-starter-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")
//gitRepositoryName = git.getRepositoryName()
//gitBranchName = sh(script: "echo ${env.GIT_BRANCH} | grep -oP '(?<=origin/).+'", returnStdout: true).trim()
//gitCommitHashShort = git.getCommitHashShort()
//gitCommitMessage = git.getCommitMessage()
//
//message = """
// :white_check_mark: <${env.BUILD_URL}|${env.JOB_NAME}-${env.BUILD_NUMBER}> *updated*
//
// |*${gitRepositoryName}:*
// |`${gitBranchName}` `${gitCommitHashShort}`
// |${gitCommitMessage}
//
// |""".stripMargin()
//slackSend(channel: jobChannel, color: '#36B37E', message: message)
}
}
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)
}
}
}
}