2024-04-03 08:47:40 +02:00
|
|
|
pipeline {
|
|
|
|
agent {
|
2024-04-14 14:50:48 +02:00
|
|
|
dockerfile {
|
|
|
|
args "-u root" // Run Docker container with root user
|
|
|
|
}
|
2024-04-03 08:47:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
string(
|
|
|
|
defaultValue: 'karol9',
|
|
|
|
description: 'Kaggle username',
|
|
|
|
name: 'KAGGLE_USERNAME',
|
|
|
|
trim: false
|
|
|
|
)
|
|
|
|
string(
|
|
|
|
defaultValue: '100',
|
|
|
|
description: 'Dataset cutoff size',
|
|
|
|
name: 'CUTOFF'
|
|
|
|
)
|
|
|
|
password(
|
|
|
|
defaultValue: '',
|
|
|
|
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
|
|
|
|
name: 'KAGGLE_KEY'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Checkout') {
|
|
|
|
steps {
|
|
|
|
git branch: 'main', url: 'https://git.wmi.amu.edu.pl/s495715/iumKC.git'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Stats in docker') {
|
|
|
|
steps {
|
|
|
|
// run python3 main.py inside docker created from dockerfile in iumKC directory
|
2024-04-14 14:33:28 +02:00
|
|
|
// sh "docker build -t iumkc ."
|
2024-04-14 14:50:48 +02:00
|
|
|
// sh "mkdir -p ~/.kaggle"
|
|
|
|
// sh "echo '{\"username\":\"${params.KAGGLE_USERNAME}\",\"key\":\"${params.KAGGLE_KEY}\"}' > ~/.kaggle/kaggle.json"
|
|
|
|
// sh "chmod 600 ~/.kaggle/kaggle.json"
|
2024-04-03 09:08:54 +02:00
|
|
|
sh "python3 main.py"
|
2024-04-03 08:47:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|