2023-03-28 13:31:04 +02:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
//Definijuemy parametry, ktore bedzie mozna podac podczas wywolywania zadania
|
2023-03-28 13:38:32 +02:00
|
|
|
parameters {
|
|
|
|
buildSelector (
|
|
|
|
name: 'BUILD_SELECTOR',
|
2023-03-28 13:39:45 +02:00
|
|
|
defaultSelector: lastSuccessful(),
|
2023-03-28 13:38:32 +02:00
|
|
|
description: 'Which build to use for copying artifacts?',
|
|
|
|
)
|
|
|
|
}
|
2023-03-28 13:31:04 +02:00
|
|
|
stages {
|
2023-03-28 13:38:32 +02:00
|
|
|
stage('Load Artifact') {
|
|
|
|
steps {
|
2023-03-28 13:46:32 +02:00
|
|
|
script {
|
2023-03-28 13:42:21 +02:00
|
|
|
copyArtifacts fingerprintArtifacts: true, projectName: 's452627-create-dataset', selector: buildParameter("BUILD_SELECTOR")
|
2023-03-28 13:46:32 +02:00
|
|
|
def previousFile = readFile(file: "output.txt")
|
|
|
|
echo("The previous build artifact was: ${previousFile}")
|
|
|
|
}
|
2023-03-28 13:38:32 +02:00
|
|
|
}
|
2023-03-28 13:39:08 +02:00
|
|
|
}
|
2023-03-28 13:31:04 +02:00
|
|
|
stage('Run Script') {
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
sh "chmod +x -R ${env.WORKSPACE}"
|
2023-03-28 13:46:32 +02:00
|
|
|
sh './make_statistic.sh | tee output_statistic.txt'
|
2023-03-28 13:31:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
stage('Archive Output') {
|
|
|
|
steps {
|
2023-03-28 13:46:32 +02:00
|
|
|
archiveArtifacts 'output_statistic.txt'
|
2023-03-28 13:31:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|