add Dockefile and edit jenkinsfile
This commit is contained in:
parent
96b5908f34
commit
9857b4339b
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM python:latest
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y
|
||||||
|
|
||||||
|
RUN pip install pandas
|
||||||
|
RUN pip install scikit-learn
|
62
JenkinsFile
62
JenkinsFile
@ -1,34 +1,50 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
parameters{
|
|
||||||
|
//Definijuemy parametry, które będzie można podać podczas wywoływania zadania
|
||||||
|
parameters{
|
||||||
string(
|
string(
|
||||||
defaultValue: '0',
|
defaultValue: '500',
|
||||||
description: 'CUTOFF',
|
description: 'CUTOFF',
|
||||||
name: 'CUTOFF',
|
name: 'CUTOFF',
|
||||||
trim: false
|
trim: false
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('clear_all') {
|
||||||
|
steps {
|
||||||
|
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
|
||||||
|
sh 'rm -rf *'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
stages {
|
|
||||||
stage('Clone repository') {
|
|
||||||
steps {
|
|
||||||
git 'https://git.wmi.amu.edu.pl/s444439/ium_z444439'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Run shell script') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
sh 'mkdir -p dataset'
|
sh 'git clone https://git.wmi.amu.edu.pl/s444439/ium_z444439'
|
||||||
sh 'curl -o dataset/adult.data https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data'
|
// Run the maven build
|
||||||
sh 'sed -i "s/ //g" dataset/adult.data'
|
sh 'curl -O https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data'
|
||||||
sh 'cut -d"," -f1,3-5,9-10,13 dataset/adult.data > dataset/processed_data.csv'
|
sh 'sed -i "1i\\age,workclass,fnlwgt,education,education-num,marital-status,occupation,relationship,race,sex,capital-gain,capital-loss,hours-per-week,native-country,income" adult.data'
|
||||||
sh 'python script.py'
|
sh 'mv adult.data adult.csv'
|
||||||
}
|
sh 'ls -a'
|
||||||
}
|
sh 'ls -a ./ium_z444439'
|
||||||
}
|
|
||||||
|
|
||||||
post {
|
}
|
||||||
always {
|
}
|
||||||
archiveArtifacts 'results/*'
|
stage('Docker') {
|
||||||
}
|
agent {
|
||||||
|
dockerfile {
|
||||||
|
filename 'Dockerfile'
|
||||||
|
dir 'ium_z444439'
|
||||||
|
reuseNode true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh 'ls -a'
|
||||||
|
sh 'python ./ium_z444439/create-dataset.py'
|
||||||
|
archiveArtifacts 'X_test.csv'
|
||||||
|
archiveArtifacts 'X_dev.csv'
|
||||||
|
archiveArtifacts 'X_train.csv'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user