pipeline {
    agent {
            docker {
                image 'aliszu1/ium:1.0'
            }
    }
        parameters {
            buildSelector (
                defaultSelector: lastSuccessful(),
                description: 'Build for copying artifacts',
                name: 'BUILD_SELECTOR'
            )
        }
    stages {
        stage('Copy Artifacts') {
            steps {
               copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464914-create-dataset', selector: buildParameter('BUILD_SELECTOR')
            }
        }
     stage('Build') {
         steps {
                 sh "python3 ./get_stats.py"
                 archiveArtifacts artifacts: 'stats.txt', onlyIfSuccessful: true
             }
         }
     }
}