Complete the code to define a Jenkins pipeline that triggers on GitHub webhook events.
pipeline {
agent any
triggers {
[1]()
}
stages {
stage('Build') {
steps {
echo 'Building...'
}
}
}
}The githubPush() trigger listens for GitHub webhook push events to start the pipeline.
Complete the code to enable webhook trigger for GitLab in a Jenkins pipeline.
pipeline {
agent any
triggers {
[1]()
}
stages {
stage('Test') {
steps {
echo 'Testing...'
}
}
}
}The gitlabPush() trigger listens for GitLab webhook push events to start the pipeline.
Fix the error in the Jenkinsfile to correctly trigger on GitHub webhook push events.
pipeline {
agent any
triggers {
[1]()
}
stages {
stage('Deploy') {
steps {
echo 'Deploying...'
}
}
}
}The correct trigger name is case-sensitive and must be githubPush.
Fill the blank to create a Jenkins pipeline that triggers on GitLab webhook push events and runs a build stage.
pipeline {
agent any
triggers {
[1]()
}
stages {
stage('Build') {
steps {
echo 'Building project...'
}
}
}
}The trigger must be gitlabPush to listen for GitLab webhook push events.
Fill the blanks to define a Jenkins pipeline that triggers on GitHub webhook push events, checks out code, and runs tests.
pipeline {
agent any
triggers {
[1]()
}
stages {
stage('Checkout') {
steps {
{{BLANK_3}} 'https://github.com/example/repo.git'
}
}
stage('Test') {
steps {
echo 'Running tests...'
}
}
}
}The trigger must be githubPush. The checkout step is used to get the code from the GitHub repository.