s
This commit is contained in:
parent
5ae03b7c89
commit
3ca40ad1f5
56
Jenkinsfile2
Normal file
56
Jenkinsfile2
Normal file
@ -0,0 +1,56 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
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
|
||||
|
||||
wc -l olympics-124-years-datasettill-2020/Athletes_summer_games.csv > output.txt
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive Artifact') {
|
||||
steps {
|
||||
archiveArtifacts 'output.txt'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user