From 821d0d7e9cee02fcb75c9142c53d90e1dcab3d07 Mon Sep 17 00:00:00 2001 From: Alicja Szulecka <73056579+AliSzu@users.noreply.github.com> Date: Sun, 14 Apr 2024 12:58:46 +0200 Subject: [PATCH] jenkins train model --- Dockerfile | 2 +- Jenkinsfile | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 42aa370..b09f625 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ RUN pip3 install kaggle pandas scikit-learn WORKDIR /app -COPY IUM_2.py ./ +COPY IUM_2.py model.py prediction.py ./ diff --git a/Jenkinsfile b/Jenkinsfile index 7525c07..8ac9773 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,5 +35,16 @@ pipeline { } } } + + stage('Train and Predict') { + steps { + def customImage = docker.build("custom-image") + customImage.inside { + sh 'python3 ./model.py' + sh 'python3 ./prediction.py' + archiveArtifacts artifacts: 'model.pth, predictions.txt', onlyIfSuccessful: true + } + } + } } } \ No newline at end of file