pipeline { agent { dockerfile true } pipelineTriggers { upstream(upstreamProjects: 'z-s464913-create-dataset', threshold: hudson.model.Result.SUCCESS) } parameters { buildSelector( defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', name: 'BUILD_SELECTOR' ) string(name: 'learning_rate', defaultValue: '0.001', description: 'Learning rate') string(name: 'epochs', defaultValue: '5', description: 'Number of epochs') } stages { stage('Clone Repository') { steps { git branch: 'training', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git' } } stage('Copy Artifacts') { steps { copyArtifacts filter: 'data/*', projectName: 'z-s464913-create-dataset', selector: buildParameter('BUILD_SELECTOR') } } stage('Run train_model script') { steps { sh 'chmod +x train_model.py' sh 'python3 ./train_model.py' } } stage('Archive Artifacts') { steps { archiveArtifacts artifacts: 'model/*', onlyIfSuccessful: true } } } }