pipeline { agent any //Definijuemy parametry, które będzie można podać podczas wywoływania zadania parameters{ string( defaultValue: 'patrykgaka', description: 'Kaggle username', name: 'KAGGLE_USERNAME', trim: false ) password( defaultValue: 'd14370cec1714b0cd1ef2875038b5950', description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', name: 'KAGGLE_KEY' ) string( defaultValue: '500', description: 'CUTOFF', name: 'CUTOFF', trim: false ) } stages { stage('clear_before') { steps { sh 'rm -rf *' } } stage('Clone Git') { steps { sh 'git clone https://git.wmi.amu.edu.pl/s434686/ium_z434686' } } stage('Build') { steps { withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { sh 'kaggle datasets download -d rush4ratio/video-game-sales-with-ratings' sh 'unzip video-game-sales-with-ratings.zip -d ./ium_z434686' } } } stage('Docker') { agent { dockerfile { filename 'Dockerfile' dir 'ium_z434686' reuseNode true } } steps { sh 'python ./ium_z434686/create-dataset.py' sh 'python ./ium_z434686/train.py' sh 'python ./ium_z434686/predict.py' archiveArtifacts 'X_test.csv' archiveArtifacts 'X_dev.csv' archiveArtifacts 'X_train.csv' archiveArtifacts 'Y_test.csv' archiveArtifacts 'Y_dev.csv' archiveArtifacts 'Y_train.csv' archiveArtifacts 'prediction.csv' } } stage('clear_after') { steps { sh 'rm -rf *' } } } post { always { build 'z-s434686-training' } } }