Jenkinsfile 2.01 KB
Newer Older
Spiros Koulouzis's avatar
Spiros Koulouzis committed
1
pipeline {
2 3 4 5 6 7 8 9
    agent none
    stages {
        stage('Build java-code') {
            agent any
            tools {
                maven "maven-3.6.2"
                jdk "openjdk-11"
            }
Spiros Koulouzis's avatar
Spiros Koulouzis committed
10 11 12
            steps {
                git branch: 'DRIP_3.0', url: 'https://github.com/skoulouzis/DRIP.git'
                sh "mvn -Dmaven.test.skip=true install"    
13
            }
Spiros Koulouzis's avatar
Spiros Koulouzis committed
14
        }
15 16 17 18
        stage('Build python-code') {
            agent {
                docker { image 'python:3.7-buster' }
            }
Spiros Koulouzis's avatar
Spiros Koulouzis committed
19
            steps {
20
                sh 'cd drip-planner && python3.7 -m venv venv && venv/bin/pip3 install -r requirements.txt'
skoulouzis's avatar
skoulouzis committed
21
                sh "cd ../"
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
                sh "cd sure_tosca-flask-server && python3.7 -m venv venv && venv/bin/pip3 install -r requirements.txt && venv/bin/pip3 install -r test-requirements.txt" 
            }
        }
        stage('Test java-code') {
            agent any
            tools {
                maven "maven-3.6.2"
                jdk "openjdk-11"
            }
            steps {
                sh "mvn test"
            }
        }     
        stage('Test python-code') {
            agent {
                docker { image 'python:3.7-buster' }
            }
            steps {
                sh "cd drip-planner && venv/bin/python3.7 -m unittest discover"   
                sh "cd sure_tosca-flask-server && venv/bin/python3.7 -m unittest discover"   
            }
        }  
        stage('Package java-code') {
            agent any
            tools {
                maven "maven-3.6.2"
                jdk "openjdk-11"
            }
            steps {
                sh "cd drip-manager && mvn -Dmaven.test.skip=true install dockerfile:build"   
            }
        }    
        stage('Package python-code') {
            agent any
            steps {
skoulouzis's avatar
skoulouzis committed
57 58 59
                sh "cd sure_tosca-flask-server && docker build -t sure-tosca:3.0.0 ."
                sh "cd ../"
                sh "cd drip-planner && docker build -t drip-planner:3.0.0 ."
Spiros Koulouzis's avatar
Spiros Koulouzis committed
60
            }
61 62
        }     
    }
Spiros Koulouzis's avatar
Spiros Koulouzis committed
63
}