Multibranch pipeline fix

This commit is contained in:
Andrzej Preibisz 2022-05-01 20:39:11 +02:00
parent 55a736d0ce
commit 9e90bd0876
2 changed files with 17 additions and 11 deletions

View File

@ -16,4 +16,4 @@ COPY ml_training.py ./
COPY heart_2020_cleaned.csv ./
CMD ["python3", "./ml_training.py", EPOCHS]
CMD ["python3", "./ml_training.py"]

View File

@ -2,14 +2,22 @@ pipeline {
agent {
dockerfile true
}
parameters {
string(
defaultValue: "10",
description: 'How many epochs during training?',
name: 'epochs'
)
}
stages {
stage("Setup parameters") {
steps {
script {
properties([
parameters([
string(
defaultValue: '10',
name: 'EPOCHS',
trim: true
)
])
])
}
}
}
stage("Git clone") {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 's444465', url: 'https://git.wmi.amu.edu.pl/s444465/ium_444465']]])
@ -17,10 +25,8 @@ pipeline {
}
stage("Training") {
steps {
withEnv(["EPOCHS=${params.EPOCHS}"]) {
sh "chmod 777 ml_training.py"
sh "python3 ml_training.py $EPOCHS"
}
sh "python3 ml_training.py"
}
}
}