-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
90 lines (90 loc) · 3.08 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
pipeline {
options { disableConcurrentBuilds() }
agent { label 'docker-slave' }
stages {
stage ('Pull repo code from github') {
steps {
checkout scm
}
}
stage('test ct-refactoring') {
steps {
sh """ #!/bin/bash
pip3 install -r requirements.txt
pip3 install -e .
python3 -m pytest --pyargs -s ${WORKSPACE}/tests --junitxml="results.xml" --cov=components/controller --cov-report xml tests/
"""
junit 'results.xml'
}
}
stage('SonarQube analysis'){
environment {
scannerHome = tool 'SonarQubeScanner'
}
steps {
withSonarQubeEnv('SonarCloud') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
stage('Build Node Manager actuator') {
steps {
sh """#!/bin/bash
./make_docker.sh build node-manager-actuator components/actuator/Dockerfile
"""
}
}
stage('Build Node Manager containers_manager') {
steps {
sh """#!/bin/bash
./make_docker.sh build node-manager-containers_manager components/containers_manager/Dockerfile
"""
}
}
stage('Build Node Manager requests_store') {
steps {
sh """#!/bin/bash
./make_docker.sh build node-manager-requests_store components/requests_store/Dockerfile
"""
}
}
stage('Build Node Manager controller') {
steps {
sh """#!/bin/bash
./make_docker.sh build node-manager-controller components/controller/Dockerfile
"""
}
}
stage('Build Node Manager dispatcher') {
steps {
sh """#!/bin/bash
./make_docker.sh build node-manager-dispatcher components/dispatcher/Dockerfile
"""
}
}
stage('Push all to sodalite-private-registry') {
when {
branch "master"
}
steps {
withDockerRegistry(credentialsId: 'jenkins-sodalite.docker_token', url: '') {
sh """#!/bin/bash
./make_docker.sh push node-manager-actuator production
./make_docker.sh push node-manager-containers_manager production
./make_docker.sh push node-manager-requests_store production
./make_docker.sh push node-manager-controller production
./make_docker.sh push node-manager-dispatcher production
"""
}
}
}
}
post {
failure {
slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
fixed {
slackSend (color: '#6d3be3', message: "FIXED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
}