This commit is contained in:
Jakub Zaręba 2023-05-10 16:07:56 +02:00
parent 99903db8b0
commit 139ef69ca8

32
Jenkinsfile vendored
View File

@ -40,23 +40,13 @@ pipeline {
} }
} }
stage('Build') { stage('Build') {
when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } } //when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } }
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 '''
// #!/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 ''' sh '''
#!/bin/bash #!/bin/bash
pip install kaggle pip install kaggle
@ -66,15 +56,29 @@ 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}"
} }
}
}
stage('Clone Git Repository') {
when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } }
steps {
script {
try {
git 'https://git.wmi.amu.edu.pl/s487187/ium_487187.git'
} catch (err) {
error "Failed to clone repository: ${err.message}"
}
} }
} }
} }
stage('End') { stage('End') {
// when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } } when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } }
steps { steps {
echo 'Program ended!' echo 'Program ended!'
} }