pipeline {
    agent none
    stages {
        stage('copy files') {
            agent any
                steps {
                    sh '''
                        cp ./lab3/script.sh .
                        cp ./lab3/python_script.py .
                        cp ./lab3/Dockerfile .
                        cp ./lab3/requirements.txt .
                        '''
                }
        }
        stage('docker') {
            agent {
                docker {
                    image 'kubakonieczny/ium:v1.0'
                }
            }
            stages {
                stage('script') {
                    steps {
                    sh '''
                    chmod +x script.sh
                    ./script.sh > stats.txt'''
                    }
                }
                stage('archive artifact') {
                    steps {
                        archiveArtifacts 'stats.txt'
                    }
                }
            }
        }
    }
}