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 fingerprintArtifacts: true, projectName: 'z-s464914-create-dataset', selector: buildParameter('BUILD_SELECTOR') 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 } } } } } }