From 3df5fd58581417b413095241474c91f2131e9f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ulaniuk?= Date: Sun, 27 Mar 2022 22:41:10 +0200 Subject: [PATCH] Data preparation and Statistics --- Jenkinsfile | 31 +++++++++++++++++++++++-------- preparation.sh | 1 + statistics.sh | 1 + 3 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 preparation.sh create mode 100644 statistics.sh diff --git a/Jenkinsfile b/Jenkinsfile index 63bfcf1..0123ac6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,30 +12,45 @@ node { defaultValue: '', description: 'Kaggle token', name: 'KAGGLE_KEY' + ), + string( + defaultValue: '10', + description: 'Cutoff', + name: 'CUTOFF' ) ]) ]) } + stage('Checkout') { + steps { + script { + git credentialsId: 'jenkins-user-github', url: 'https://git.wmi.amu.edu.pl/s478831/ium_478855.git' + sh "ls -lart ./*" + sh "git branch -a" + sh "git checkout master" + } + } + } stage('Build') { withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { sh 'echo "BUILD"' sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' - sh 'kaggle datasets list' + //sh 'kaggle datasets list' } } stage('Preparation') { - withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", - "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { - sh 'echo "PREPARATION"' + sh 'echo "PREPARATION"' + sh "chmod u+x ./preparation.sh" + sh "KAGGLE_USERNAME=${KAGGLE_USERNAME} KAGGLE_KEY=${KAGGLE_KEY} CUTOFF=${CUTOFF} ./preparation.sh" + archiveArtifacts 'KaggleV2-May-2016.csv' } } stage('Statistics') { - withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", - "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { - sh 'echo "STATISTICS"' - } + sh "chmod u+x ./preparation.sh" + sh "KAGGLE_USERNAME=${KAGGLE_USERNAME} KAGGLE_KEY=${KAGGLE_KEY} CUTOFF=${CUTOFF} ./preparation.sh" + archiveArtifacts 'statistics.csv' } } diff --git a/preparation.sh b/preparation.sh new file mode 100644 index 0000000..dfe1747 --- /dev/null +++ b/preparation.sh @@ -0,0 +1 @@ +echo "Preparation inner" \ No newline at end of file diff --git a/statistics.sh b/statistics.sh new file mode 100644 index 0000000..65062f9 --- /dev/null +++ b/statistics.sh @@ -0,0 +1 @@ +wc -l KaggleV2-May-2016.csv >> statistics.csv \ No newline at end of file