2024-03-20 11:17:00 +01:00
|
|
|
pipeline {
|
2024-03-20 12:11:18 +01:00
|
|
|
agent any
|
2024-03-20 12:34:32 +01:00
|
|
|
|
2024-03-20 13:04:02 +01:00
|
|
|
parameters {
|
2024-03-20 13:02:23 +01:00
|
|
|
string(
|
|
|
|
defaultValue: 'jakubbg',
|
|
|
|
description: 'Kaggle username',
|
|
|
|
name: 'KAGGLE_USERNAME',
|
|
|
|
trim: false
|
2024-03-20 13:04:02 +01:00
|
|
|
)
|
2024-03-20 13:02:23 +01:00
|
|
|
password(
|
|
|
|
defaultValue: 'e42b293c818e4ecd7b9365ee037af428',
|
|
|
|
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
|
|
|
|
name: 'KAGGLE_KEY'
|
|
|
|
)
|
2024-03-20 13:35:01 +01:00
|
|
|
string(
|
|
|
|
defaultValue: '100',
|
|
|
|
description: 'CUTOFF parameter',
|
|
|
|
name: 'CUTOFF',
|
|
|
|
trim: false
|
|
|
|
)
|
2024-03-20 13:04:02 +01:00
|
|
|
}
|
2024-03-20 12:58:03 +01:00
|
|
|
|
|
|
|
stages {
|
2024-03-20 12:43:09 +01:00
|
|
|
stage('Build') {
|
2024-03-20 12:46:12 +01:00
|
|
|
steps {
|
|
|
|
// Run the maven build
|
|
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
|
|
|
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
|
|
|
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
|
|
|
|
sh 'kaggle datasets list'
|
|
|
|
}
|
2024-03-20 12:43:09 +01:00
|
|
|
}
|
|
|
|
}
|
2024-03-20 12:34:32 +01:00
|
|
|
stage('Checkout') {
|
2024-03-20 12:11:18 +01:00
|
|
|
steps {
|
2024-03-20 12:34:32 +01:00
|
|
|
// Krok: Sklonowanie repozytorium git
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Execute Shell Script') {
|
|
|
|
steps {
|
|
|
|
// Krok: Wywołanie skryptu shella
|
|
|
|
script {
|
|
|
|
sh 'chmod +x data_processing_script.sh' // Nadaj uprawnienia do wykonania skryptu
|
|
|
|
sh './data_processing_script.sh' // Wykonaj skrypt
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Archive Artifacts') {
|
|
|
|
steps {
|
|
|
|
// Krok: Zarchiwizowanie artefaktów
|
2024-03-20 13:20:36 +01:00
|
|
|
archiveArtifacts artifacts: 'processed_data.csv', fingerprint: true
|
2024-03-20 12:11:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-03-20 12:22:50 +01:00
|
|
|
}
|