From 4ab9baa0c56d1b9acefa07ef0f4612a993f461e7 Mon Sep 17 00:00:00 2001 From: Tomasz Koszarek Date: Sat, 25 Mar 2023 13:43:53 +0100 Subject: [PATCH] Update 'Jenkinsfile' --- Jenkinsfile | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f47bc4b..acef5e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,25 @@ -pipeline { - agent any - - stages { - stage('Hello') { - steps { - echo 'Hello World' - } - } +node { + stage('Preparation') { + properties([ + parameters([ + string( + defaultValue: 'Hello World!', + description: 'Tekst do wyświetlenie', + name: 'INPUT_TEXT', + trim: false + ) + ]) + ]) + } + stage('Hello') { + //Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!) + echo "INPUT_TEXT: ${INPUT_TEXT}" + //Wywołaj w konsoli komendę "figlet", która generuje ASCI-art + sh "figlet \"${INPUT_TEXT}\" | tee output.txt" + } + stage('Goodbye') { + echo 'Goodbye!' + //Zarchiwizuj wynik + archiveArtifacts 'output.txt' } } \ No newline at end of file