ium_464914/Jenkinsfile
Alicja Szulecka f883cd5e17 add parameter
2024-04-29 21:21:21 +02:00

34 lines
1.1 KiB
Groovy

pipeline {
agent any
}
parameters {
buildSelector (
defaultSelector: lastSuccessful(),
description: 'Build for copying artifacts',
name: 'BUILD_SELECTOR'
)
string(name: 'EPOCHS', defaultValue: '10', description: 'epochs')
}
stages {
stage('Git Checkout') {
steps {
checkout scm
}
}
stage('Copy Artifacts') {
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464914-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Train') {
steps {
script {
def customImage = docker.build("custom-image")
customImage.inside {
sh 'python3 ./model.py ${params.EPOCHS}'
archiveArtifacts artifacts: 'model.pth, predictions.txt', onlyIfSuccessful: true
}
}
}
}
}