Jenkins can validate a Declarative Pipeline from the command line before actually running it. This can be done using a Jenkins CLI command or by making an HTTP POST request with appropriate parameters.
Example
Suppose you have a simple Jenkinsfile-test like this:pipeline {
agent any
stages {
stage('List files') {
steps {
sh 'ls -al'
}
}
}
}
agent any
stages {
stage('List files') {
steps {
sh 'ls -al'
}
}
}
}
And you want to check if the sintax is correct before using it.
Validation
All you have to do is to execute this command:curl -s -X POST -F "jenkinsfile=<Jenkinsfile-test" \
https://user:password@jenkins.example.com/pipeline-model-converter/validate
Note that user and password are the credentials you usually use to authenticate in Jenkins web console.
Output
✅If it's all ok, you should get:
Jenkinsfile successfully validated.
❌If there are some errors, then you should get an error message.
For example, let's remove the steps section in the stage.
Trying to validate again Jenkinsfile-test, we get:
Errors encountered validating Jenkinsfile:
WorkflowScript: 13: Unknown stage section "sh". Starting with version 0.5, steps in a stage must be in a ‘steps’ block. @ line 13, column 9.
stage('List files') {
^
WorkflowScript: 13: Expected one of "steps", "stages", or "parallel" for stage "List files" @ line 13, column 9.
stage('List files') {
^
https://bayanlarsitesi.com/
ReplyDeleteGöktürk
Yenidoğan
Şemsipaşa
Çağlayan
VOKE
görüntülü show
ReplyDeleteücretlishow
V58
D3999
ReplyDeletemalatya canlı sohbet odası
sesli sohbet sitesi
bilecik rastgele sohbet odaları
eskişehir rastgele sohbet uygulaması
elazığ görüntülü sohbet ücretsiz
konya bedava görüntülü sohbet sitesi
mobil sesli sohbet
mersin canlı sohbet ücretsiz
bitlis görüntülü sohbet yabancı
60B48
ReplyDeleteantalya canlı sohbet siteleri
bartın canlı görüntülü sohbet odaları
canlı sohbet odaları
canlı sohbet bedava
siirt telefonda sohbet
kütahya sesli sohbet sesli chat
artvin en iyi sesli sohbet uygulamaları
Izmir Sohbet Odaları
bursa kadınlarla ücretsiz sohbet