devops interview
devops interview
WORKDIR /app
THRESHOLD=80
EMAIL="your_email@example.com"
Example (Declarative):
groovyCopyEditpipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building...'
}
}
stage('Test') {
steps {
echo 'Testing...'
}
}
stage('Deploy') {
steps {
echo 'Deploying...'
}
}
}
}
Example:
bashCopyEditecho "Hello" > file.txt # Overwrites
echo "World" >> file.txt # Appends
7. Skip failed build and continue in Jenkins:
Use catchError, try-catch, or unstable status.
groovyCopyEditstage('Optional Step') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh './fail-prone-script.sh'
}
}
}
Would you like me to compile this set into a downloadable PDF as well?