pipeline {
    agent { dockerfile true }

   stages {
       stage('Githubcheck')
       {
           steps{
               git 'https://git.wmi.amu.edu.pl/s460929/s460929-mlworkshops.git'
           }
       }

       stage("CopyArtifacts")
       {
           steps{
               copyArtifacts filter: 'wikiniews_results.tsv', fingerprintArtifacts: true, projectName: 'ASR-eval', selector: lastSuccessful()
               copyArtifacts filter: 'srr_results.txt wer_resulsts.txt', fingerprintArtifacts: true, projectName: 's460929-metrics', optional: true, selector: lastSuccessful()
           }
       }

       stage("Script")
       {
           steps{
               sh label:"", script:"bash ./count.sh"
           }
       }

       stage("PythonScript")
       {
           steps{
               sh label: '', script: 'python script.py'
           }
       }

       stage("Result")
       {
           steps{
               archiveArtifacts 'srr_results.txt'
               archiveArtifacts 'wer_results.txt'
               archiveArtifacts 'newresults.tsv'
               archiveArtifacts 'hypothesis.trn' 
               archiveArtifacts 'reference.trn'
           }
       }
      stage('Hello') {
         steps {
            echo 'Hello World'
            // sh label:'', script: 'whoami'
            
         }
      }

      stage("Build Metrics")
      {
          steps
          {
             build 's460929-plots'   
          }
      }
      
   }
}