ium_464913/Jenkinsfile
2024-06-01 17:24:14 +02:00

68 lines
1.5 KiB
Groovy

pipeline {
agent any
parameters {
string (
defaultValue: 'vskyper',
description: 'Kaggle username',
name: 'KAGGLE_USERNAME',
trim: false
)
password (
defaultValue: '',
description: 'Kaggle API key',
name: 'KAGGLE_KEY',
)
}
stages {
stage('Clone Repository') {
steps {
git branch: 'main', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git'
}
}
stage('Download dataset') {
steps {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh 'pip install kaggle'
sh 'kaggle datasets download -d mlg-ulb/creditcardfraud'
sh 'unzip -o creditcardfraud.zip'
sh 'rm creditcardfraud.zip'
}
}
}
stage('Run create-dataset script') {
agent {
dockerfile {
reuseNode true
}
}
steps {
sh 'chmod +x create-dataset.py'
sh 'python3 ./create-dataset.py'
}
}
stage('Archive Artifacts from create-dataset') {
steps {
archiveArtifacts artifacts: 'data/*', onlyIfSuccessful: true
}
}
stage('Experiments') {
steps {
sh 'chmod +x sacred/sacred_train_evaluation.py'
sh 'python3 sacred/sacred_train_evaluation.py'
}
}
stage('Archive Artifacts from Experiments') {
steps {
archiveArtifacts artifacts: 'experiments/*', onlyIfSuccessful: true
}
}
}
}