I have the following Jenkinsfile which I believe is setup correctly. I used https://jenkins.io/doc/book/pipeline/syntax/#sequential-stages as an example but for some reason when I run this in jenkins I am receiving,
WorkflowScript: 11: Unknown stage section "stages". Starting with version 0.5, steps in a stage must be in a steps block
Can someone tell me what I am missing or doing wrong?
pipeline {
agent {label 'windows'}
stages {
stage('Quick Build') {
steps {
echo 'Building'
}
}
stage('Deploy to Dev') {
// when {
// branch 'develop'
// }
stages {
stage('Building Distributable Package') {
steps {
echo 'Building'
}
}
stage('Archiving Package') {
steps {
echo 'Archiving Aritfacts'
archiveArtifacts artifacts: '/*.zip', fingerprint: true
}
}
stage('Deploying Dev') {
steps {
echo 'Deploying'
timeout(time:3, unit:'DAYS') {
input message: "Approve build?"
}
}
}
}
}
stage('Deploy to Test') {
when {
branch 'develop'
}
steps {
echo 'deploying..'
timeout(time:3, unit:'DAYS') {
input message: "Approve build?"
}
}
}
stage('Deploy to Prod') {
when {
branch 'release'
}
steps {
timeout(time:3, unit:'DAYS') {
input message: "Deploy to Prod?"
}
echo 'Deploying....'
}
}
}
}
Thanks in advance!
when
sytax and it worked for me stackoverflow.com/questions/37690920/… – TheViralGriffin