Commit 7b831d65 authored by Spiros Koulouzis's avatar Spiros Koulouzis

changed jenkinsfile to use docker

parent 9c4d5d93
pipeline {
agent any
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "maven-3.6.2"
jdk "openjdk-11"
}
stages {
stage('Build') {
agent none
stages {
stage('Build java-code') {
agent any
tools {
maven "maven-3.6.2"
jdk "openjdk-11"
}
steps {
echo 'Building'
git branch: 'DRIP_3.0', url: 'https://github.com/skoulouzis/DRIP.git'
sh "mvn -Dmaven.test.skip=true install"
sh "cd drip-planner && python3.7 -m venv venv && venv/bin/pip3 install -r requirements.txt"
sh "cd ../"
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"
sh "pwd && ls"
}
}
stage('Test') {
steps {
echo 'Testing'
sh "mvn test"
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') {
stage('Build python-code') {
agent {
docker { image 'python:3.7-buster' }
}
steps {
echo 'Deploying'
sh "cd drip-manager && mvn -Dmaven.test.skip=true install dockerfile:build"
sh 'cd drip-planner && python3.7 -m venv venv && venv/bin/pip3 install -r requirements.txt'
sh "cd ../"
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 {
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 ."
}
}
stage('Deploy') {
steps {
echo 'Deploying'
}
}
}
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="e478ccae-5352-4e8e-9efb-3f5cda44e877" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<list default="true" id="e478ccae-5352-4e8e-9efb-3f5cda44e877" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......
pipeline {
agent any
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "maven-3.6.2"
jdk "openjdk-11"
}
stages {
stage('Build') {
steps {
echo 'Building'
git branch: 'DRIP_3.0', url: 'https://github.com/skoulouzis/DRIP.git'
sh "mvn -Dmaven.test.skip=true install"
sh "cd drip-planner && python3 -m venv venv && venv/bin/pip3 install -r requirements.txt"
sh "cd ../"
sh "cd sure_tosca-flask-server && python3 -m venv venv && venv/bin/pip3 install -r requirements.txt && venv/bin/pip3 install -r test-requirements.txt"
sh "pwd && ls"
}
}
stage('Test') {
steps {
echo 'Testing'
//sh "mvn test"
//sh "cd drip-planner && venv/bin/python3 -m unittest discover"
//sh "cd sure_tosca-flask-server && venv/bin/python3 -m unittest discover"
}
}
stage('Package') {
steps {
echo 'Deploying'
sh "cd drip-manager && mvn -Dmaven.test.skip=true install dockerfile:build"
}
}
stage('Deploy') {
steps {
echo 'Deploying'
}
}
}
}
FROM python:3.7-alpine
FROM python:3.7-buster
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment