Modifed Jenkisfile and added data.sh

This commit is contained in:
Dawid 2021-03-28 20:35:30 +02:00
parent 4211e73763
commit 3397cd0901
2 changed files with 37 additions and 0 deletions

29
Jenkinsfile vendored
View File

@ -8,3 +8,32 @@ pipeline {
} }
} }
} }
pipeline{
agent any
properties([parameters([text(defaultValue: '100', description: 'Number of lines to cutoff', name: 'CUT')])])
stages{
stage('Stage 1'){
steps{
echo 'Init Jenkins file!'
}
}
stage('checkout: Check out from version control'){
steps{
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '87e24204-a0e1-4840-b235-2b993c922d83', url: 'https://git.wmi.amu.edu.pl/s434804/ium_434804']]])
}
}
stage('sh: Shell Script'){
steps{
withEnv(["CUTOFF=${params.CUT}"])
./data.sh
}
}
stage('Archive artifacts'){
steps{
archiveArtifacts 'test.csv'
archiveArtifacts 'validation.csv'
archiveArtifacts 'train.csv'
}
}
}
}

8
data Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
curl -OL https://git.wmi.amu.edu.pl/s434804/ium_434804/raw/branch/master/country_vaccinations.csv
head -n -1 country_vaccinations.csv | tail -n +$((${CUTOFF}+1)) > country_vaccinations.csv | shuf > vaccines.csv.shuf
wc -l vaccines.csv
head -n 1468 vaccines.csv.shuf > test.csv
head -n 2936 vaccines.csv.shuf | tail -n 1468 > validation.csv
tail -n +2936 vaccines.csv.shuf > train.csv
wc -l *.csv