Zaktualizuj 'Jenkinsfile'

This commit is contained in:
Michał Kaleta 2023-03-25 13:53:02 +01:00
parent ff5c3ce67a
commit 7278528c52

49
Jenkinsfile vendored
View File

@ -1,25 +1,26 @@
node { pipeline {
stage('Preparation') { agent any
properties([
parameters([ stages {
string( stage('Clone repository') {
defaultValue: 'Hello World!', steps {
description: 'Tekst do wyświetlenie', checkout([$class: 'GitSCM', branches: [[name: '*/master']],
name: 'INPUT_TEXT', doGenerateSubmoduleConfigurations: false,
trim: false extensions: [], submoduleCfg: [],
) userRemoteConfigs: [[url: 'https://github.com/your-username/your-repo.git']]])
]) }
]) }
stage('Process data') {
steps {
sh './process_data.sh'
}
}
stage('Archive artifacts') {
steps {
archiveArtifacts artifacts: 'results.txt', onlyIfSuccessful: true
}
}
} }
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'
}
}