From efe1e410b6d6d9b70b397fc03ee489c657ef02e2 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Fri, 1 Apr 2022 22:40:28 +0200 Subject: [PATCH] Added docker to jenkins --- Jenkinsfile-docker | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Jenkinsfile-docker diff --git a/Jenkinsfile-docker b/Jenkinsfile-docker new file mode 100644 index 0000000..a902a6d --- /dev/null +++ b/Jenkinsfile-docker @@ -0,0 +1,36 @@ +pipeline { + parameters { + string( + defaultValue: 'marcinkostrzewski', + 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' + ) + } + + agent { + dockerfile { + additionalBuildArgs "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY}" + } + } + + stages { + stage('Run data stats') { + steps { + sh "python power_plant_data_stats.py" + } + } + } + + post { + always { + archiveArtifacts artifacts: 'data/*', + onlyIfSuccessful: true + } + } +}