2023-04-15 14:07:05 +02:00
|
|
|
pipeline {
|
|
|
|
agent any
|
2023-04-16 08:19:21 +02:00
|
|
|
parameters {
|
|
|
|
buildSelector(
|
|
|
|
name: 'BUILD_SELECTOR',
|
|
|
|
description: 'Which build to use for copying artifacts',
|
2023-04-16 08:20:49 +02:00
|
|
|
defaultSelector: lastSuccessful()
|
2023-04-16 08:19:21 +02:00
|
|
|
)
|
|
|
|
}
|
2023-04-15 14:07:05 +02:00
|
|
|
stages {
|
2023-04-16 08:14:58 +02:00
|
|
|
stage('Checkout git clone') {
|
2023-04-15 14:07:05 +02:00
|
|
|
steps {
|
|
|
|
git branch: 'master', url: 'https://git.wmi.amu.edu.pl/s487175/ium_z487175.git'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Copy dataset artifacts') {
|
|
|
|
steps {
|
|
|
|
copyArtifacts(
|
|
|
|
projectName: 'z-s487175-create-dataset',
|
|
|
|
fingerprintArtifacts: true,
|
2023-04-16 08:22:46 +02:00
|
|
|
selector: buildParameter('BUILD_SELECTOR')
|
2023-04-15 14:07:05 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2023-04-18 08:31:13 +02:00
|
|
|
stage('Run a shell script in a docker container') {
|
2023-04-16 08:38:45 +02:00
|
|
|
steps {
|
2023-04-18 08:31:13 +02:00
|
|
|
//Docker image - pobieranie i uruchomienie
|
2023-04-18 08:36:28 +02:00
|
|
|
sh 'docker run nbrt10/ium:v1 /app/s487175-dataset-stats-script.sh > output.txt'
|
2023-04-16 08:38:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Archive file') {
|
|
|
|
steps {
|
2023-04-18 08:40:49 +02:00
|
|
|
sh "docker cp \$(docker ps -l -q):/app/output.txt ${env.WORKSPACE}"
|
2023-04-16 08:38:45 +02:00
|
|
|
archiveArtifacts artifacts: 'output.txt', fingerprint: true
|
|
|
|
}
|
|
|
|
}
|
2023-04-15 14:07:05 +02:00
|
|
|
}
|
|
|
|
}
|