From 382a84a90cb6f0eefe873dba74d424da252ae7a7 Mon Sep 17 00:00:00 2001 From: ulaniuk Date: Wed, 4 May 2022 19:18:48 +0200 Subject: [PATCH] t --- Dockerfile | 6 ++-- Jenkinsfile | 36 +++++++++--------------- Jenkinsfile2 | 0 scripts/create_data.py => create_data.py | 0 preparation.sh | 1 + scripts/preparation.sh | 1 - scripts/statistics.sh | 1 - statistics.sh | 1 + scripts/stats_data.py => stats_data.py | 0 scripts/train_model.py => train_model.py | 0 10 files changed, 20 insertions(+), 26 deletions(-) create mode 100644 Jenkinsfile2 rename scripts/create_data.py => create_data.py (100%) create mode 100644 preparation.sh delete mode 100644 scripts/preparation.sh delete mode 100644 scripts/statistics.sh create mode 100644 statistics.sh rename scripts/stats_data.py => stats_data.py (100%) rename scripts/train_model.py => train_model.py (100%) diff --git a/Dockerfile b/Dockerfile index 32694e9..26119bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7 +FROM ubuntu:latest WORKDIR / @@ -17,7 +17,9 @@ RUN pip install --user seaborn COPY KaggleV2-May-2016.csv ./ COPY create_data.py ./ COPY stats_data.py ./ -COPY stats_data.py ./ +COPY train_model.py ./ + +CMD ["python", "train_model.py"] # CMD ["python", "create_data.py"] # CMD ["python", "stats_data.py"] diff --git a/Jenkinsfile b/Jenkinsfile index a2e6fa3..d18875a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,4 @@ pipeline { - agent any parameters{ password( defaultValue: '', @@ -22,8 +21,13 @@ pipeline { KAGGLE_KEY="$params.KAGGLE_KEY" CUTOFF="$params.CUTOFF" } - stages { - stage('Checkout') { + agent + { + dockerfile true + } + + stages { + stage('Checkout') { steps { script { git credentialsId: 'jenkins-user-github', url: 'https://git.wmi.amu.edu.pl/s478855/ium_478855.git' @@ -33,27 +37,15 @@ pipeline { } } } - stage("Build docker") { + stage("Preparation") { steps { - sh 'echo "BUILD DOCKER"' - sh 'docker build -t ium .' - } - } - stage("Data Preparation") { - steps { - sh 'echo "DATA PREPARATION"' sh "chmod u+x ./preparation.sh" - sh "./preparation.sh" - archiveArtifacts 'KaggleV2-May-2016.csv' + sh "./preparation.sh" + archiveArtifacts 'KaggleV2-May-2016.csv' + archiveArtifacts 'data_description.csv' + archiveArtifacts 'train_dataset.csv' + archiveArtifacts 'test_dataset.csv' } } - stage("Statistics") { - steps { - sh 'echo "STATISTICS"' - sh "chmod u+x ./statistics.sh" - sh "./statistics.sh" - archiveArtifacts 'statistics.csv' - } - } - } + } } \ No newline at end of file diff --git a/Jenkinsfile2 b/Jenkinsfile2 new file mode 100644 index 0000000..e69de29 diff --git a/scripts/create_data.py b/create_data.py similarity index 100% rename from scripts/create_data.py rename to create_data.py diff --git a/preparation.sh b/preparation.sh new file mode 100644 index 0000000..ca01906 --- /dev/null +++ b/preparation.sh @@ -0,0 +1 @@ +python ./scripts/create_data.py \ No newline at end of file diff --git a/scripts/preparation.sh b/scripts/preparation.sh deleted file mode 100644 index dfe1747..0000000 --- a/scripts/preparation.sh +++ /dev/null @@ -1 +0,0 @@ -echo "Preparation inner" \ No newline at end of file diff --git a/scripts/statistics.sh b/scripts/statistics.sh deleted file mode 100644 index 65062f9..0000000 --- a/scripts/statistics.sh +++ /dev/null @@ -1 +0,0 @@ -wc -l KaggleV2-May-2016.csv >> statistics.csv \ No newline at end of file diff --git a/statistics.sh b/statistics.sh new file mode 100644 index 0000000..ff9ca01 --- /dev/null +++ b/statistics.sh @@ -0,0 +1 @@ +python ./scripts/statistics.py \ No newline at end of file diff --git a/scripts/stats_data.py b/stats_data.py similarity index 100% rename from scripts/stats_data.py rename to stats_data.py diff --git a/scripts/train_model.py b/train_model.py similarity index 100% rename from scripts/train_model.py rename to train_model.py