mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
Added Jenkinsfile
This commit is contained in:
parent
3e082c575c
commit
8a0765f0bc
1 changed files with 64 additions and 0 deletions
64
Jenkinsfile.groovy
Normal file
64
Jenkinsfile.groovy
Normal file
|
@ -0,0 +1,64 @@
|
|||
def notifySlack(String buildStatus = 'STARTED') {
|
||||
// Build status of null means success.
|
||||
buildStatus = buildStatus ?: 'SUCCESS'
|
||||
|
||||
def color
|
||||
|
||||
if (buildStatus == 'STARTED') {
|
||||
color = '#D4DADF'
|
||||
} else if (buildStatus == 'SUCCESS') {
|
||||
color = '#BDFFC3'
|
||||
} else if (buildStatus == 'UNSTABLE') {
|
||||
color = '#FFFE89'
|
||||
} else {
|
||||
color = '#FF9FA1'
|
||||
}
|
||||
|
||||
def msg = "${buildStatus}: `${env.JOB_NAME}` #${env.BUILD_NUMBER}: ${env.GIT_COMMIT}\n${env.BUILD_URL}"
|
||||
|
||||
slackSend(color: color, channel: '#status-k8s', message: msg)
|
||||
}
|
||||
|
||||
pipeline {
|
||||
options {
|
||||
buildDiscarder(logRotator(daysToKeepStr: '7', numToKeepStr: '10'))
|
||||
}
|
||||
agent any
|
||||
parameters {
|
||||
string(name: 'TESTNAMESPACE', defaultValue: 'arangodb-operator-tests', description: 'TESTNAMESPACE sets the kubernetes namespace to ru tests in', )
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
timestamps {
|
||||
sh "make"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
stage('Test with Direct') {
|
||||
steps {
|
||||
timestamps {
|
||||
lock("kubernetes-operator-tests") {
|
||||
withEnv([
|
||||
'TESTNAMESPACE=${params.TESTNAMESPACE}',
|
||||
]) {
|
||||
sh "make run-tests"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
failure {
|
||||
notifySlack('FAILURE')
|
||||
}
|
||||
|
||||
success {
|
||||
notifySlack('SUCCESS')
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue