Complete jenkinsfile toolkit with generation and validation capabilities
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
A team wants to validate their containerized deployment pipeline before submitting it for code review. The pipeline uses a company-wide shared library. They've had issues in the past where the Jenkinsfile passed validation but failed at runtime because the shared library had changed.
Validate the pipeline and produce a validation-report.md that covers both the Jenkinsfile itself and any concerns related to the shared library dependency.
The following file is provided. Extract it before beginning.
=============== FILE: inputs/Jenkinsfile =============== @Library('platform-lib') _
pipeline { agent { label 'docker' }
environment {
IMAGE_NAME = "myapp"
REGISTRY = "registry.company.com"
}
stages {
stage('Build Image') {
steps {
buildAndPush(
imageName: "${REGISTRY}/${IMAGE_NAME}",
tag: env.BUILD_NUMBER
)
}
}
stage('Deploy') {
steps {
deployApp(
environment: 'staging',
imageTag: env.BUILD_NUMBER
)
}
}
}}