-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
58 lines (48 loc) · 1.68 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
properties properties: [
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '30', numToKeepStr: '10']],
disableConcurrentBuilds()
]
@Library('holisticon-build-library')
def build = new de.holisticon.ci.jenkins.Build()
def notify = new de.holisticon.ci.jenkins.Notify()
node {
def buildNumber = env.BUILD_NUMBER
def branchName = env.BRANCH_NAME
def workspace = env.WORKSPACE
def buildUrl = env.BUILD_URL
def image
// PRINT ENVIRONMENT TO JOB
echo "workspace directory is $workspace"
echo "build URL is $buildUrl"
echo "build Number is $buildNumber"
echo "branch name is $branchName"
echo "PATH is $env.PATH"
try {
stage('Checkout') {
deleteDir()
checkout scm
}
stage('Build') {
sh "pip install -r requirements-dev.txt"
sh "make lint"
sh "make build"
}
stage('Test') {
sh "make test"
junit 'build/reports/TESTS.xml'
}
stage('Integration-Test') {
sh returnStatus: true, script: "docker-compose build"
sh "docker-compose build"
sh "docker-compose up -d"
sh "make end2end_test"
sh "ansible-playbook test_end2end.yml"
sh "docker-compose down"
}
echo "Current build status: $currentBuild.currentResult"
} catch (e) {
echo "Current build status: $currentBuild.currentResult"
notify.buildMessage(currentBuild, true, 'holi-oss', 'Error with recent changes: ' + build.releaseNotes(currentBuild))
throw e
}
}