From 1527bdb1ad15de86bd193e9e56e791ef2d7f88d8 Mon Sep 17 00:00:00 2001 From: MatOgr Date: Sun, 3 Apr 2022 21:30:07 +0200 Subject: [PATCH] Script Jnkns with volume mapping test --- jenkins/Jenkinsfile_docker | 58 ++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/jenkins/Jenkinsfile_docker b/jenkins/Jenkinsfile_docker index 7f8cc39..5f14c1f 100644 --- a/jenkins/Jenkinsfile_docker +++ b/jenkins/Jenkinsfile_docker @@ -1,26 +1,42 @@ -pipeline { +// pipeline { - agent { - dockerfile { - additionalBuildArgs "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} -t s478841-create-dataset" - } +// agent { +// dockerfile { +// additionalBuildArgs "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} -t s478841-create-dataset" +// } +// } + +// stages { +// stage('Simple data stats') { +// steps { +// sh 'chmod u+x ./scripts/data_stats.sh' +// sh """ +// docker run +// """ +// sh './scripts/data_stats.sh' +// } +// } +// } + +// post { +// always { +// archiveArtifacts artifacts: 'data/*', +// onlyIfSuccessful: true +// } +// } +// } + +node { + checkout scm + + def dataImage = docker.build('s478841-image', "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} .") + + dataImage.inside('-v $WORKSPACE:/output -u root') { + sh 'chmod u+x ./scripts/data_stats.sh' + sh './scripts/data_stats.sh' } - stages { - stage('Simple data stats') { - steps { - sh 'chmod u+x ./scripts/data_stats.sh' - sh 'ls -al' - sh './scripts/data_stats.sh' - } - } - } - - post { - always { - archiveArtifacts artifacts: 'data/*', - onlyIfSuccessful: true - } + stage('Archive arifacts') { + archiveArtifacts artifacts: 'avocado.data*', followSymlinks: false, onlyIfSuccessful: true } } -