From 28d6a255facc55908a35b728a02ac51d1169bcd4 Mon Sep 17 00:00:00 2001 From: Anna Nowak Date: Sun, 11 Apr 2021 22:19:45 +0200 Subject: [PATCH] Jenkinsfile test --- Dockerfile | 3 +-- Jenkinsfile | 64 +++++++++++++++++++++-------------------------------- 2 files changed, 26 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index b86402d..bf742ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,5 +6,4 @@ WORKDIR /app COPY ["requirements.txt", "./"] RUN pip3 install -r requirements.txt -COPY ["Zadanie 1.py", "."] -CMD python3.8 "Zadanie 1.py" \ No newline at end of file +COPY ["Zadanie 1.py", "."] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 7fdac72..61da745 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,46 +1,32 @@ pipeline { - agent any - parameters{ - string( - defaultValue: 'annadnowak', - 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: '10', - description: 'CUTOFF', - name: 'CUTOFF' - ) + agent { + docker { image 'adnovac/ium_s434760:latest' } } - stages { - stage('checkout: Check out from version control') { - steps { - git 'https://git.wmi.amu.edu.pl/s434760/ium_434760.git' - } - } - stage('sh: Shell Script') - { - steps { - withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", - "KAGGLE_KEY=${params.KAGGLE_KEY}", "CUTOFF=${params.CUTOFF}"]) { - sh "chmod 777 ./script.sh" - sh './script.sh' - + parameters{ + string( + defaultValue: 'annadnowak', + 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' + ) + stage('docker: Download artifacts') + { + steps { + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}") { + sh 'python3.8 \"Zadanie 1.py\"' } } } - stage('archive artifacts') { - steps { - archiveArtifacts 'test.csv,data_shuf.csv,validation.csv,train.csv,header.csv' - } + } + stage('archive artifacts') { + steps { + archiveArtifacts 'test.csv,data_shuf.csv,validation.csv,train.csv,header.csv' } } -} - -//docker run -e KAGGLE_KEY -e KAGGLE_USERNAME -ti ium_434760:latest \ No newline at end of file +} \ No newline at end of file