2023-03-28 12:20:45 +02:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
//Definijuemy parametry, ktore bedzie mozna podac podczas wywolywania zadania
|
|
|
|
parameters {
|
|
|
|
string (
|
|
|
|
name: 'INPUT_TEXT',
|
2023-03-28 12:34:55 +02:00
|
|
|
defaultValue: 'Hello World!',
|
|
|
|
description: 'Tekst, ktorym chcesz przywitac swiat',
|
2023-03-28 12:20:45 +02:00
|
|
|
trim: false
|
|
|
|
)
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Hello') {
|
|
|
|
steps {
|
|
|
|
//Wypisz wartosc parametru w konsoli (To nie jest polecenie bash, tylko groovy!)
|
2023-03-28 12:34:55 +02:00
|
|
|
echo "INPUT_TEXT: ${INPUT_TEXT}"
|
2023-03-28 12:20:45 +02:00
|
|
|
//Wywolaj w konsoli komende "figlet", ktora generuje ASCI-art
|
2023-03-28 12:34:55 +02:00
|
|
|
sh "figlet \"${INPUT_TEXT}\" | tee output.txt"
|
2023-03-28 12:20:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Goodbye!') {
|
|
|
|
steps {
|
|
|
|
echo 'Goodbye!'
|
|
|
|
//Zarchiwizuj wynik
|
|
|
|
archiveArtifacts 'output.txt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|