0
0
Jenkinsdevops~10 mins

Migration strategies in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a Jenkins pipeline stage for migration.

Jenkins
stage('Migration') {
    steps {
        sh '[1]'
    }
}
Drag options to blanks, or click blank then click option'
Adeploy.sh
Bmigrate.sh
Cbuild.sh
Dtest.sh
Attempts:
3 left
💡 Hint
Common Mistakes
Using build or test scripts instead of migration script.
Forgetting to specify the script in the shell command.
2fill in blank
medium

Complete the code to add a post-migration cleanup step in Jenkins pipeline.

Jenkins
post {
    always {
        sh '[1]'
    }
}
Drag options to blanks, or click blank then click option'
Acleanup.sh
Bmigrate.sh
Cdeploy.sh
Dbuild.sh
Attempts:
3 left
💡 Hint
Common Mistakes
Running migration or build scripts in the cleanup step.
Not using the post block for cleanup.
3fill in blank
hard

Fix the error in the Jenkins pipeline snippet to correctly run migration only on the master branch.

Jenkins
when {
    branch '[1]'
}
Drag options to blanks, or click blank then click option'
Amaster
Bdevelop
Cfeature
Drelease
Attempts:
3 left
💡 Hint
Common Mistakes
Using a feature or develop branch instead of master.
Forgetting to specify the branch condition.
4fill in blank
hard

Fill both blanks to create a Jenkins pipeline step that runs migration script with environment variables.

Jenkins
steps {
    withEnv(['DB_USER=[1]', 'DB_PASS=[2]']) {
        sh './migrate.sh'
    }
}
Drag options to blanks, or click blank then click option'
Aadmin
Bpassword123
Cuser
Dsecret
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping username and password values.
Using generic words instead of credentials.
5fill in blank
hard

Fill all three blanks to define a Jenkins pipeline stage that runs migration, verifies success, and cleans up.

Jenkins
stage('Migration') {
    steps {
        sh './[1]'
        sh './[2]'
        sh './[3]'
    }
}
Drag options to blanks, or click blank then click option'
Amigrate.sh
Bverify.sh
Ccleanup.sh
Ddeploy.sh
Attempts:
3 left
💡 Hint
Common Mistakes
Running deploy script instead of verify or cleanup.
Mixing the order of scripts.