Complete the code to define a Jenkins pipeline stage for migration.
stage('Migration') { steps { sh '[1]' } }
The migration stage runs the migration script migrate.sh to update the database or system.
Complete the code to add a post-migration cleanup step in Jenkins pipeline.
post {
always {
sh '[1]'
}
}The cleanup.sh script is run after migration to clean temporary files or reset states.
Fix the error in the Jenkins pipeline snippet to correctly run migration only on the master branch.
when {
branch '[1]'
}The migration should run only on the master branch to avoid affecting other branches.
Fill both blanks to create a Jenkins pipeline step that runs migration script with environment variables.
steps {
withEnv(['DB_USER=[1]', 'DB_PASS=[2]']) {
sh './migrate.sh'
}
}The environment variables DB_USER and DB_PASS are set to admin and password123 respectively for migration authentication.
Fill all three blanks to define a Jenkins pipeline stage that runs migration, verifies success, and cleans up.
stage('Migration') { steps { sh './[1]' sh './[2]' sh './[3]' } }
The pipeline runs migrate.sh to migrate, verify.sh to check success, and cleanup.sh to clean temporary files.