-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile
90 lines (88 loc) · 2.82 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
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
82
83
84
85
86
87
88
89
90
#!groovy
pipeline {
agent any
stages {
stage('Checkout') {
steps {
echo 'Stage: Checkout...'
checkout scm
}
}
stage('Container build') {
steps {
echo 'Stage: Building...'
sh "pipeline/build/build.sh"
}
}
stage('Unittests') {
steps {
echo 'Stage: Testing...'
sh "pipeline/unittest/test.sh"
}
}
stage('Style check') {
steps {
echo 'Stage: Style check...'
sh "pipeline/checkstyle/check.sh"
}
}
stage('Smoke tests') {
steps {
echo 'Stage: Smoke test... (not implemented)'
}
}
stage('Integration tests (SDK-tools)')
{
steps {
echo 'Stage: Integration tests (SDK-tools)'
// ensure that no old container is there
sh "docker rm -f tng-sdk-project || true"
sh "docker run --rm --name tng-sdk-project-int registry.sonata-nfv.eu:5000/tng-sdk-project pipeline/unittest/test_sdk_integration.sh"
}
}
stage ("Downstream jobs: Trigger tng-sdk-package build") {
when{
branch 'master'
}
steps {
build job: '../tng-sdk-package-pipeline/master', wait: true
}
}
stage('Container publication') {
steps {
echo 'Stage: Container publication...'
sh "pipeline/publish/publish.sh"
}
}
// for release v5.0
stage('Promoting release v5.0') {
when {
branch 'v5.0'
}
stages {
stage('Generating release') {
steps {
sh 'docker tag registry.sonata-nfv.eu:5000/tng-sdk-project:latest registry.sonata-nfv.eu:5000/tng-sdk-project:v5.0'
sh 'docker tag registry.sonata-nfv.eu:5000/tng-sdk-project:latest sonatanfv/tng-sdk-project:v5.0'
sh 'docker push registry.sonata-nfv.eu:5000/tng-sdk-project:v5.0'
sh 'docker push sonatanfv/tng-sdk-project:v5.0'
}
}
}
}
}
post {
success {
emailext(from: "[email protected]",
to: "[email protected]",
subject: "SUCCESS: ${env.JOB_NAME}/${env.BUILD_ID} (${env.BRANCH_NAME})",
body: "${env.JOB_URL}")
}
failure {
emailext(from: "[email protected]",
to: "[email protected]",
subject: "FAILURE: ${env.JOB_NAME}/${env.BUILD_ID} (${env.BRANCH_NAME})",
body: "${env.JOB_URL}")
}
}
}