ium_487187/Jenkinsfile2

61 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-03-28 20:39:28 +02:00
pipeline {
2023-04-04 19:23:40 +02:00
agent {
docker {
2023-04-04 20:11:59 +02:00
image 's487187/ium:1'
2023-04-04 19:23:40 +02:00
args '-u root:root'
}
}
2023-03-28 20:39:28 +02:00
parameters {
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
}
stages {
stage('Clone Git Repository') {
steps {
script {
try {
git 'https://git.wmi.amu.edu.pl/s487187/ium_487187.git'
} catch (err) {
error "Failed to clone repository: ${err.message}"
}
}
}
}
stage('Copy Artifact') {
steps {
script {
try {
copyArtifacts(
projectName: 's487187-create-dataset',
selector: buildParameter('BUILD_SELECTOR')
)
} catch (err) {
error "Failed to copy artifact: ${err.message}"
}
}
}
}
stage('Count Lines') {
steps {
sh '''
#!/bin/bash
2023-04-04 19:23:40 +02:00
python3 count_lines.py --input_file olympics-124-years-datasettill-2020/Athletes_summer_games.csv > output.txt
2023-03-28 20:39:28 +02:00
'''
}
}
stage('Archive Artifact') {
steps {
archiveArtifacts 'output.txt'
}
}
}
}