Added Jenkinsfile

This commit is contained in:
Jakub Henyk 2023-03-28 12:20:45 +02:00
parent bd84848bf6
commit f2b4a50fb8

29
Jenkinsfile.txt Normal file
View File

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