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

changed jenkinsfile to use docker

parent 9c4d5d93
pipeline { pipeline {
agent none
stages {
stage('Build java-code') {
agent any agent any
tools { tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "maven-3.6.2" maven "maven-3.6.2"
jdk "openjdk-11" jdk "openjdk-11"
} }
stages {
stage('Build') {
steps { steps {
echo 'Building'
git branch: 'DRIP_3.0', url: 'https://github.com/skoulouzis/DRIP.git' git branch: 'DRIP_3.0', url: 'https://github.com/skoulouzis/DRIP.git'
sh "mvn -Dmaven.test.skip=true install" sh "mvn -Dmaven.test.skip=true install"
sh "cd drip-planner && python3.7 -m venv venv && venv/bin/pip3 install -r requirements.txt" }
}
stage('Build python-code') {
agent {
docker { image 'python:3.7-buster' }
}
steps {
sh 'cd drip-planner && python3.7 -m venv venv && venv/bin/pip3 install -r requirements.txt'
sh "cd ../" 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 "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') { stage('Test java-code') {
agent any
tools {
maven "maven-3.6.2"
jdk "openjdk-11"
}
steps { steps {
echo 'Testing'
sh "mvn test" 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 drip-planner && venv/bin/python3.7 -m unittest discover"
sh "cd sure_tosca-flask-server && venv/bin/python3.7 -m unittest discover" sh "cd sure_tosca-flask-server && venv/bin/python3.7 -m unittest discover"
} }
} }
stage('Package') { stage('Package java-code') {
agent any
tools {
maven "maven-3.6.2"
jdk "openjdk-11"
}
steps { steps {
echo 'Deploying'
sh "cd drip-manager && mvn -Dmaven.test.skip=true install dockerfile:build" sh "cd drip-manager && mvn -Dmaven.test.skip=true install dockerfile:build"
sh "cd ../"
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') { stage('Package python-code') {
agent any
steps { steps {
echo 'Deploying' 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 ."
} }
} }
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e478ccae-5352-4e8e-9efb-3f5cda44e877" name="Default Changelist" comment=""> <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>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <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 RUN mkdir -p /usr/src/app
WORKDIR /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