ium_z487179/createDataset/Jenkinsfile

69 lines
2.1 KiB
Groovy

pipeline {
agent any
parameters {
string(
defaultValue: 'wojciechbatruszewicz',
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'
)
string(
defaultValue: '50',
description: 'dataset cutoff',
name: 'CUTOFF',
trim: false
)
}
stages {
stage('Download dataset') {
steps {
checkout scm
dir ('./createDataset') {
sh 'ls -l'
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
// sh 'chmod +x ./datasetScript.sh'
// sh './datasetScript.sh'
sh 'kaggle datasets download -d rishikeshkonapure/home-loan-approval'
sh 'unzip -o home-loan-approval.zip'
}
}
}
}
stage('Docker') {
steps {
script {
def dockerImage = docker.build("docker-image", "./docker")
dockerImage.inside {
sh 'ls -l'
dir ('./createDataset') {
sh 'ls -l'
sh 'python3 ./createDataset.py'
archiveArtifacts 'home_loan_train.csv'
archiveArtifacts 'home_loan_test.csv'
archiveArtifacts 'home_loan_val.csv'
}
}
}
}
}
stage('triggerTrain') {
steps {
build job: "z-s487179-train", wait: true
}
}
// stage('Archive file') {
// steps {
// dir ('./createDataset') {
// archiveArtifacts artifacts: 'loan_sanction_shuffled.csv', fingerprint: true\
// }
// }
// }
}
}