pipeline { agent { dockerfile true } triggers { upstream(upstreamProjects: 's464953-training/training', threshold: hudson.model.Result.SUCCESS) } parameters { buildSelector(defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', name: 'BUILD_SELECTOR') gitParameter branchFilter: 'origin/(.*)', defaultValue: 'training', name: 'BRANCH', type: 'PT_BRANCH' } stages { stage('Clone Repository') { steps { git 'https://git.wmi.amu.edu.pl/s464953/ium_464953.git' } } stage('Copy Training Artifacts') { steps { copyArtifacts filter: 'artifacts/*', projectName: 's464953-training/' + params.BRANCH, selector: buildParameter('BUILD_SELECTOR') } } stage('Copy Evaluation Artifacts') { steps { copyArtifacts filter: 'metrics_df.csv', projectName: '_s464953-evaluation/evaluation', selector: buildParameter('BUILD_SELECTOR'), optional: true } } stage('Run Script') { steps { sh "python3 /app/use_model.py ${currentBuild.number}" } } stage('Archive Artifacts') { steps { archiveArtifacts artifacts: 'metrics_df.csv, spotify_genre_predictions.csv, F1_score_plot.png, RMSE_plot.png, Accuracy_plot.png', onlyIfSuccessful: true } } } }