0
0
Jenkinsdevops~10 mins

GitHub Actions comparison 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.

Jenkins
stage('[1]') {
    steps {
        echo 'Building the project'
    }
}
Drag options to blanks, or click blank then click option'
ACleanup
BTest
CDeploy
DBuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Test' or 'Deploy' as the first stage name.
2fill in blank
medium

Complete the code to trigger a Jenkins pipeline on a GitHub push event.

Jenkins
pipeline {
    agent any
    triggers {
        [1]()
    }
    stages {
        stage('Build') {
            steps {
                echo 'Building...'
            }
        }
    }
}
Drag options to blanks, or click blank then click option'
AgithubPush
Bcron
CpollSCM
DgithubPushTrigger
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cron' which is a time-based trigger.
3fill in blank
hard

Fix the error in the Jenkinsfile snippet to correctly checkout code from GitHub.

Jenkins
pipeline {
    agent any
    stages {
        stage('Checkout') {
            steps {
                [1] scm
            }
        }
    }
}
Drag options to blanks, or click blank then click option'
Acheckout
Bclone
CgitCheckout
Dpull
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'clone' or 'pull' which are git commands but not Jenkins steps.
4fill in blank
hard

Fill both blanks to define environment variables and use them in a Jenkins pipeline.

Jenkins
pipeline {
    agent any
    environment {
        APP_NAME = '[1]'
        APP_ENV = '[2]'
    }
    stages {
        stage('Print Env') {
            steps {
                echo "App: $APP_NAME, Environment: $APP_ENV"
            }
        }
    }
}
Drag options to blanks, or click blank then click option'
AMyApp
BProduction
CDevelopment
DTest
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing environment names or using invalid variable names.
5fill in blank
hard

Fill all three blanks to create a Jenkins pipeline stage that runs a shell command with parameters.

Jenkins
pipeline {
    agent any
    stages {
        stage('[1]') {
            steps {
                sh '[2] [3]'
            }
        }
    }
}
Drag options to blanks, or click blank then click option'
ATest
Bnpm test
C--verbose
DBuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong stage names or incomplete shell commands.