From c1d525dd55558cc7ecb9d77e1f9f5044e60a8af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Miko=C5=82ajski?= Date: Wed, 19 Apr 2023 18:53:55 +0200 Subject: [PATCH] Update 'Jenkinsfile-Docker' --- Jenkinsfile-Docker | 57 ++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/Jenkinsfile-Docker b/Jenkinsfile-Docker index 249827c..1e7c1e1 100644 --- a/Jenkinsfile-Docker +++ b/Jenkinsfile-Docker @@ -1,34 +1,27 @@ -node { - 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') { - def dockerImage = docker.build("create-dataset") - sh 'docker run python3 create_dataset.py $CUT' +pipeline { + agent { + dockerfile true + } - archiveArtifacts artifacts: 'waterQuality.csv, output.txt' - } + stages { + stage('Checkout') { + steps { + checkout scm + } + } + + stage('Build Docker image') { + steps { + sh 'docker build -t wujt89 -f Dockerfile .' + } + } + + stage('Run command in Docker container') { + steps { + script { + sh "docker run -v ${env.WORKSPACE}/artifacts:/app/artifacts wujt89 python3 create_dataset.py" + } + } + } + } } \ No newline at end of file