From 4d8739503e945d225459caebadefc47c768481cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Pogodzi=C5=84ski?= Date: Sat, 15 May 2021 19:08:29 +0200 Subject: [PATCH] jenkinsfile_train --- Jenkinsfile-stats | 3 ++- Jenkinsfile_train | 51 +++++++++++++++++++++++++++++++++++++++++++++++ script.sh | 2 +- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 Jenkinsfile_train diff --git a/Jenkinsfile-stats b/Jenkinsfile-stats index a3c845f..056e40e 100644 --- a/Jenkinsfile-stats +++ b/Jenkinsfile-stats @@ -13,7 +13,8 @@ pipeline{ stage('Docker') { steps { script { - docker.image("jpogodzinski/ium:1").inside { + def img=docker.build('jpogodzinski/ium:1') + img.inside { sh 'rm -rf ium_s437622' sh 'git clone https://git.wmi.amu.edu.pl/s437622/ium_s437622.git' sh "chmod +x ium_s437622/stats.sh" diff --git a/Jenkinsfile_train b/Jenkinsfile_train new file mode 100644 index 0000000..93dab2f --- /dev/null +++ b/Jenkinsfile_train @@ -0,0 +1,51 @@ +pipeline { + agent any + parameters { + buildSelector( + defaultSelector: lastSuccessful(), + description: 'Which build to use for copying artifacts', + name: 'BUILD_SELECTOR') + } + stages { + stage('checkout') { + steps { + checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s437622/ium_437622.git']]]) + } + } + stage('Copy artifact') { + steps { + copyArtifacts filter: 'dev.csv, train.csv, test.csv', fingerprintArtifacts: false, projectName: 's437622-create-dataset', selector: buildParameter('BUILD_SELECTOR') + } + } + stage('docker') { + steps { + script { + def img = docker.build('jpogodzinski/ium:1') + img.inside { + sh 'chmod +x zad5.py' + sh 'python3 ./zad5.py' + } + } + } + } + + stage('end') { + steps { + archiveArtifacts 'model/saved_model.pb' + } + } + } + post { + success { + //Wysłanie maila + emailext body: 'Success train', subject: 's437622 train', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + build job: 's426206-evaluation/master', string(name: 'BUILD_SELECTOR', value: '')] + + } + + failure { + emailext body: 'Failed train', subject: 's426206 train', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + } + + } +} \ No newline at end of file diff --git a/script.sh b/script.sh index 74e8446..2582b51 100755 --- a/script.sh +++ b/script.sh @@ -1,6 +1,6 @@ #!/bin/bash curl -OL https://git.wmi.amu.edu.pl/s437622/ium_s437622/src/branch/master/games.csv -tail -n +2 games.csv | shuf > chess.csv.shuf +tail -n +2 chess.csv | shuf > chess.csv.shuf wc -l chess.csv head -n 2006 chess.csv.shuf > test.csv head -n 4012 chess.csv.shuf | tail -n 2006 > dev.csv