This commit is contained in:
Jakub Zaręba 2023-05-10 16:04:37 +02:00
parent 22d024f9c9
commit 26e5e32481

43
Jenkinsfile vendored
View File

@ -15,17 +15,17 @@ pipeline {
try { try {
properties([ properties([
parameters([ parameters([
string( // string(
defaultValue: '', // defaultValue: '',
description: 'Kaggle username', // description: 'Kaggle username',
name: 'KAGGLE_USERNAME', // name: 'KAGGLE_USERNAME',
trim: false // trim: false
), // ),
password( // password(
defaultValue: '', // defaultValue: '',
description: 'Kaggle token taken from kaggle.json file', // description: 'Kaggle token taken from kaggle.json file',
name: 'KAGGLE_KEY' // name: 'KAGGLE_KEY'
), // ),
string( string(
defaultValue: '50', defaultValue: '50',
description: 'number of examples in dataset', description: 'number of examples in dataset',
@ -44,10 +44,20 @@ pipeline {
steps { steps {
script { script {
try { try {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", // withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { // "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' // sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
sh ''' // sh '''
// #!/bin/bash
// pip install kaggle
// git clone https://git.wmi.amu.edu.pl/s487187/ium_487187.git
// echo "Processed Data" > output.txt
// '''
// sh "head -n ${params.CUTOFF} data.csv"
// }
sh '''
#!/bin/bash #!/bin/bash
pip install kaggle pip install kaggle
@ -55,8 +65,7 @@ pipeline {
echo "Processed Data" > output.txt echo "Processed Data" > output.txt
''' '''
sh "head -n ${params.CUTOFF} data.csv" sh "head -n ${params.CUTOFF} data.csv"
}
} catch (err) { } catch (err) {
error "Failed to build: ${err.message}" error "Failed to build: ${err.message}"
} }