update IUM_04.Konteneryzacja - zadanie 3.1

This commit is contained in:
Norbert Walkowiak 2023-04-17 20:16:44 +02:00
parent b98e9fc1c3
commit d3f7c9edd5

21
Jenkinsfile vendored
View File

@ -43,20 +43,33 @@ pipeline {
git branch: 'master', url: 'https://git.wmi.amu.edu.pl/s487175/ium_z487175.git'
}
}
stage('Shell script') {
stage('Download from kaggle') {
steps {
sh 'kaggle datasets download -d shivam2503/diamonds > output.txt'
sh 'unzip -o diamonds.zip >> output.txt'
// przypisanie uprawnień
sh 'chmod +x s487175-create-dataset-script.py'
// wywołanie skryptu z poprzednich zajęć
sh 'python3 ./s487175-create-dataset-script.py >> output.txt'
}
}
stage('Build image') {
steps {
sh 'docker build -t ium -f dockerfile .'
}
}
stage('Run command in container') {
steps {
script {
// Uruchamia instancje obrazu ium
sh 'docker run -d -v ${env.WORKSPACE}/artifacts:/app/artifacts ium'
// Uruchomienie skryptu w kontenerze
sh 'docker exec -i ium python3 ./s487175-create-dataset-script.py'
}
}
}
stage('Archive file') {
steps {
archiveArtifacts artifacts: 'output.txt, diamonds.csv', fingerprint: true
}
}
}
}
}