ium_464914/Jenkinsfile
2024-04-30 16:03:02 +02:00

44 lines
1.3 KiB
Groovy

pipeline {
agent any
parameters {
buildSelector (
defaultSelector: lastSuccessful(),
description: 'Build for copying artifacts',
name: 'BUILD_SELECTOR'
)
}
stages {
stage('Git Checkout') {
steps {
checkout scm
}
}
stage('Copy Artifacts') {
steps {
copyArtifacts filter: '*', projectName: 's464914-training/experiments/', selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Prediction') {
steps {
script {
def customImage = docker.build("custom-image")
customImage.inside {
sh 'python3 ./prediction.py'
archiveArtifacts artifacts: 'predictions.txt', onlyIfSuccessful: true
}
}
}
}
stage('Metrics') {
steps {
script {
def customImage = docker.build("custom-image")
customImage.inside {
sh 'python3 ./metrics.py'
archiveArtifacts artifacts: 'metrics.txt', onlyIfSuccessful: true
}
}
}
}
}
}