forked from ARGOeu/argo-connectors
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
54 lines (54 loc) · 1.97 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pipeline {
agent any
options {
checkoutToSubdirectory('argo-connectors')
}
environment {
PROJECT_DIR="argo-connectors"
GIT_COMMIT=sh(script: "cd ${WORKSPACE}/$PROJECT_DIR && git log -1 --format=\"%H\"",returnStdout: true).trim()
GIT_COMMIT_HASH=sh(script: "cd ${WORKSPACE}/$PROJECT_DIR && git log -1 --format=\"%H\" | cut -c1-7",returnStdout: true).trim()
GIT_COMMIT_DATE=sh(script: "date -d \"\$(cd ${WORKSPACE}/$PROJECT_DIR && git show -s --format=%ci ${GIT_COMMIT_HASH})\" \"+%Y%m%d%H%M%S\"",returnStdout: true).trim()
}
stages {
stage ('Execute tests') {
agent {
docker {
image 'argo.registry:5000/epel-9-ams'
alwaysPull true
args '-u jenkins:jenkins -v /dev/log:/dev/log'
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/
make wheel-devel
make clean
poetry run pip install *.whl
poetry run coverage run -m xmlrunner discover --output-file junit.xml -v tests/
poetry run coverage xml
'''
cobertura coberturaReportFile: '**/coverage.xml'
junit '**/junit.xml'
}
}
}
post {
always {
cleanWs()
}
success {
script{
if ( env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'devel' ) {
slackSend( message: ":rocket: New version for <$BUILD_URL|$PROJECT_DIR>:$BRANCH_NAME Job: $JOB_NAME !")
}
}
}
failure {
script{
if ( env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'devel' ) {
slackSend( message: ":rain_cloud: Build Failed for <$BUILD_URL|$PROJECT_DIR>:$BRANCH_NAME Job: $JOB_NAME")
}
}
}
}
}