diff --git a/Jenkinsfile-Docker b/Jenkinsfile-Docker index 9d33d27..fbeea36 100644 --- a/Jenkinsfile-Docker +++ b/Jenkinsfile-Docker @@ -27,19 +27,13 @@ node { } stage('Build Docker Image') { def dockerImage = docker.build("create-dataset") - - dockerImage.inside { - withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}", "CUT = ${params.CUT}" ]) - { - sh 'ls -l' - sh 'echo $KAGGLE_USERNAME' - sh 'kaggle datasets download -d mssmartypants/water-quality > output.txt' - sh 'unzip -o water-quality.zip >> output.txt' - sh 'python3 create_dataset.py $CUT >> output.txt' - archiveArtifacts artifacts: 'waterQuality.csv, output.txt' - } - } + { + sh 'docker run -v ${env.WORKSPACE}/artifacts:/app/artifacts python3 create_dataset.py $CUT' + } + + archiveArtifacts artifacts: 'waterQuality.csv, output.txt' } } \ No newline at end of file