61 lines
1.9 KiB
Plaintext
61 lines
1.9 KiB
Plaintext
node {
|
|
stage('Preparation') {
|
|
properties([
|
|
parameters([
|
|
string(
|
|
defaultValue: 'filippatyk',
|
|
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: '200',
|
|
description: 'CUTOFF',
|
|
name: 'CUTOFF',
|
|
trim: false
|
|
),
|
|
])
|
|
])
|
|
}
|
|
|
|
stage('Git clone') {
|
|
//cloning git repo
|
|
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 's424714', url: 'https://git.wmi.amu.edu.pl/s424714/ium_424714']]])
|
|
}
|
|
|
|
stage('Dockerfile build') {
|
|
|
|
|
|
sh "chmod +x -R ${env.WORKSPACE}"
|
|
|
|
def dockerImage = docker.build("dataset-create")
|
|
|
|
dockerImage.inside("""-w=${WORKSPACE} """){
|
|
stage("Docker container running") {
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
|
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
|
|
|
sh "kaggle datasets download -p data --unzip clmentbisaillon/fake-and-real-news-dataset && python ./dataset.py --dataset"
|
|
sh "cp ./data/dataset/* ${WORKSPACE}"
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Saving artefacts') {
|
|
echo 'Goodbye!'
|
|
sh 'ls'
|
|
archiveArtifacts artifacts: '*.csv'
|
|
}
|
|
}
|
|
// post {
|
|
// success {
|
|
// build job: 's424714-training'
|
|
// }
|
|
// } |