Update Jenkinsfile

This commit is contained in:
Agata 2022-03-26 15:22:41 +01:00
parent cb236969d4
commit 16750b5831
2 changed files with 27 additions and 2 deletions

26
Jenkinsfile vendored
View File

@ -1,9 +1,31 @@
pipeline {
agent any
parameters {
string(
defaultValue: '',
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'
)
}
stages {
stage('Stage 1') {
stage('Check out from version control') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s444421/ium_444421.git']]])
}
}
stage('Shell Script') {
steps {
echo 'Hello world!'
sh 'chmod u+x ./download_data.sh'
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}","KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh './download_data.sh'
}
archiveArtifacts 'travel_insurance_data.txt'
}
}
}

3
download_data.sh Normal file
View File

@ -0,0 +1,3 @@
kaggle datasets download -d tejashvi14/travel-insurance-prediction-data
unzip -o travel-insurance-prediction-data.zip
head -n 15 TravelInsurancePrediction.csv >> travel_insurance_data.txt