From 3f1def11e3fca90f3e3e82886a1c4aca2ef08b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Miko=C5=82ajski?= Date: Wed, 19 Apr 2023 19:50:03 +0200 Subject: [PATCH] Update 'Jenkinsfile-Docker' --- Jenkinsfile-Docker | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile-Docker b/Jenkinsfile-Docker index 944c2ef..e78d907 100644 --- a/Jenkinsfile-Docker +++ b/Jenkinsfile-Docker @@ -1,10 +1,38 @@ node { - sh "chmod +x create_dataset.py" - checkout scm - def testImage = docker.build("test-image") - testImage.inside { - - sh 'ls -l' - sh 'python3 create_dataset.py' + stage('Preparation') { + properties([ + parameters([ + string( + defaultValue: 'login', + 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: '7999', + description: 'Cut off value', + name: 'CUT', + trim: false + ) + ]) + ]) + } + stage('checkout: Check out from version control') { + checkout scm + } +stage('Build Docker image') { + steps { + sh 'docker build -t wujt89 -f Dockerfile .' } +} + stage('sh: Shell Script') { + script { + sh 'docker run -v ${env.WORKSPACE}/artifacts:/app/artifacts wujt89 python3 ./create_dataset.py' + } + } } \ No newline at end of file