2023-04-19 18:03:00 +02:00
|
|
|
node {
|
|
|
|
stage('Preparation') {
|
|
|
|
properties([
|
|
|
|
parameters([
|
|
|
|
string(
|
|
|
|
defaultValue: 'login',
|
|
|
|
description: 'Kaggle username',
|
|
|
|
name: 'KAGGLE_USERNAME',
|
|
|
|
trim: false
|
|
|
|
),
|
|
|
|
password(
|
|
|
|
defaultValue: '',
|
|
|
|
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
|
|
|
|
name: 'KAGGLE_KEY'
|
|
|
|
),
|
|
|
|
string(
|
|
|
|
defaultValue: '7999',
|
|
|
|
description: 'Cut off value',
|
|
|
|
name: 'CUT',
|
|
|
|
trim: false
|
|
|
|
)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
}
|
|
|
|
stage('checkout: Check out from version control') {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
stage('Build Docker Image') {
|
|
|
|
def dockerImage = docker.build("create-dataset")
|
|
|
|
|
|
|
|
dockerImage.inside {
|
|
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
|
|
|
"KAGGLE_KEY=${params.KAGGLE_KEY}",
|
|
|
|
"CUT = ${params.CUT}" ])
|
|
|
|
{
|
2023-04-19 18:27:29 +02:00
|
|
|
sh 'ls -l'
|
|
|
|
sh 'echo $KAGGLE_USERNAME'
|
2023-04-19 18:03:00 +02:00
|
|
|
sh 'kaggle datasets download -d mssmartypants/water-quality > output.txt'
|
|
|
|
sh 'unzip -o water-quality.zip >> output.txt'
|
|
|
|
sh 'python3 create_dataset.py $CUT >> output.txt'
|
|
|
|
archiveArtifacts artifacts: 'waterQuality.csv, output.txt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|