ium_464914/Jenkinsfile

39 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-03-20 14:34:00 +01:00
pipeline {
2024-04-02 14:15:40 +02:00
agent any
2024-03-26 18:56:58 +01:00
parameters {
2024-04-02 14:13:40 +02:00
string(name: 'KAGGLE_USERNAME', defaultValue: 'alicjaszulecka', description: 'Kaggle username')
password(name: 'KAGGLE_KEY', defaultValue:'', description: 'Kaggle Key')
string(name: 'CUTOFF', defaultValue: '100', description: 'cut off number')
2024-03-26 18:56:58 +01:00
}
2024-03-20 14:34:00 +01:00
stages {
2024-04-02 19:05:02 +02:00
stage('Git Checkout') {
steps {
checkout scm
}
}
2024-04-02 19:36:23 +02:00
stage('Download dataset') {
steps {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh 'pip install kaggle'
2024-04-13 18:55:49 +02:00
sh 'kaggle datasets download -d uciml/forest-cover-type-dataset'
sh 'unzip -o forest-cover-type-dataset.zip'
sh 'rm forest-cover-type-dataset.zip'
2024-04-02 19:36:23 +02:00
}
}
}
2024-04-02 14:13:40 +02:00
stage('Build') {
steps {
2024-04-02 14:25:32 +02:00
script {
2024-04-02 14:13:40 +02:00
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
2024-04-02 15:23:13 +02:00
def customImage = docker.build("custom-image")
2024-04-02 14:27:03 +02:00
customImage.inside {
2024-04-02 19:28:05 +02:00
sh 'python3 ./IUM_2.py'
2024-04-13 18:55:49 +02:00
archiveArtifacts artifacts: 'covtype.csv, forest_train.csv, forest_test.csv, forest_val.csv', onlyIfSuccessful: true
2024-04-02 14:24:01 +02:00
}
2024-04-02 14:13:40 +02:00
}
}
}
2024-04-02 14:25:32 +02:00
}
2024-04-02 14:13:40 +02:00
}
}