IUM_03 - update Jenkinsfile, add pipeline for downloading dataset from kaggle

This commit is contained in:
Paweł Łączkowski 2024-03-20 17:26:55 +01:00
parent 563e205f2d
commit 597432d618
3 changed files with 35 additions and 2 deletions

32
Jenkinsfile vendored
View File

@ -1,9 +1,37 @@
pipeline {
agent any
parameters {
password (
name: 'KAGGLE_USERNAME',
defaultValue: '',
description: 'Kaggle username'
),
password (
name: 'KAGGLE_KEY',
defaultValue: '',
description: 'Kaggle API key'
),
number (
name: 'CUTOFF',
defaultValue: '10',
description: 'Get only the first CUTOFF rows of the dataset'
)
}
stages {
stage('Stage 1') {
stage('Clone repository') {
steps {
echo 'Hello world!'
checkout scm
}
}
stage('Download dataset') {
steps {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh './download_dataset.sh ${params.CUTOFF}'
archiveArtifacts artifacts: 'data.csv', onlyIfSuccessful: true
}
}
}
}

4
download_dataset.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
kaggle datasets download -d uciml/breast-cancer-wisconsin-data
unzip -o breast-cancer-wisconsin-data.zip
head -n "$1" data.csv > data.csv.tmp && mv data.csv.tmp data.csv

1
get_stats.sh Normal file
View File

@ -0,0 +1 @@
# TODO