changed Jenkinsfile
This commit is contained in:
parent
4d73f67dd7
commit
9dc2f55ed7
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
@ -1,28 +1,22 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
//Definijuemy parametry, które będzie można podać podczas wywoływania zadania
|
|
||||||
parameters {
|
|
||||||
string (
|
|
||||||
defaultValue: 'Hello World!',
|
|
||||||
description: 'Tekst, którym chcesz przywitać świat',
|
|
||||||
name: 'INPUT_TEXT',
|
|
||||||
trim: false
|
|
||||||
)
|
|
||||||
}
|
|
||||||
stages {
|
stages {
|
||||||
stage('Hello') {
|
stage('Clone repository') {
|
||||||
steps {
|
steps {
|
||||||
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
|
checkout([$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: 'https://github.com/your/repo.git']]])
|
||||||
echo "INPUT_TEXT: ${INPUT_TEXT}"
|
|
||||||
//Wywołaj w konsoli komendę "figlet", która generuje ASCII-art
|
|
||||||
sh "figlet \"${INPUT_TEXT}\" | tee output.txt"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Goodbye!') {
|
stage('Run shell script') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Goodbye!'
|
script {
|
||||||
//Zarchiwizuj wynik
|
sh './scripts/data_processing.sh'
|
||||||
archiveArtifacts 'output.txt'
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
archiveArtifacts artifacts: 'results.txt', allowEmptyArchive: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user