def FAILURE_STAGE
pipeline {
   agent any
   stages {
      stage('Clone repo') {
         steps {
            script{
                FAILURE_STAGE=env.STAGE_NAME
            }
            cleanWs()
            git credentialsId: 'gitlab', url: 'https://gitlab.seis.exa2pro.iti.gr/exa2pro/starpu.git', branch: 'fpga'
            
         }
      }
      stage('Build') {
         steps {
            script{
                FAILURE_STAGE=env.STAGE_NAME
            }
            sh '''
                ./autogen.sh
                ./configure --prefix=/home/jenkins/.jenkins/workspace/starpu_pipeline_updated/lib --disable-build-examples
                make
                make install
                '''
         }
      }
      stage('Test') {
         steps {
            script{
                FAILURE_STAGE=env.STAGE_NAME
            }
            sh '''
                cd examples/cholesky
                ./cholesky.sh
                '''
         }
      }
   }
}