ium_426206/Jenkinsfile_train
Jan Nowak 6a76b0713f
All checks were successful
s426206-evaluation/pipeline/head This commit looks good
s426206-training/pipeline/head This commit looks good
jktrain trigger eval with git param.
2021-05-16 12:31:56 +02:00

70 lines
2.3 KiB
Plaintext

pipeline {
agent any
triggers {
upstream(upstreamProjects: "s426206-create-dataset",
threshold: hudson.model.Result.SUCCESS)
}
parameters {
string(
defaultValue: '',
description: 'Parametry trenowania.',
name: 'PARAMETRY',
trim: false)
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/s426206/ium_426206.git']]])
}
}
stage('Copy artifact') {
steps {
copyArtifacts filter: 'train_dataset.pt,val_dataset.pt', fingerprintArtifacts: false, projectName: 's426206-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage('docker') {
steps {
script {
def img = docker.build('rokoch/ium:01')
img.inside {
sh 'chmod +x dlgssdpytorch.py'
sh 'python3 ./dlgssdpytorch.py $PARAMETRY'
}
}
}
}
stage('end') {
steps {
//Zarchiwizuj wynik
archiveArtifacts 'model.pt'
}
}
}
post {
success {
//Wysłanie maila
emailext body: 'Success train',
subject: 's426206 train',
to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
//Uruchamianie innego zadania
build job: 's426206-evaluation/master', parameters: [string(name: 'BUILD_SELECTOR_TRAINING', value: '<StatusBuildSelector plugin="copyartifact@1.46"/>'), string(name: 'BUILD_SELECTOR_DATASET', value: '<StatusBuildSelector plugin="copyartifact@1.46"/>'), string(name: 'BUILD_SELECTOR_EVALUATION', value: '<StatusBuildSelector plugin="copyartifact@1.46"/>'), gitParameter(name: 'BRANCH', value: 'master')]
}
unstable {
emailext body: 'Unstable train', subject: 's426206 train', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
failure {
emailext body: 'Failure train', subject: 's426206 train', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
changed {
emailext body: 'Changed train', subject: 's426206 train', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
}
}