Complete the code to install a plugin in Jenkins using the CLI.
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin [1]
The git plugin is a common plugin to extend Jenkins for Git repository support.
Complete the code to restart Jenkins after installing a plugin.
java -jar jenkins-cli.jar -s http://localhost:8080 [1]
The safe-restart command restarts Jenkins safely after plugin installation.
Fix the error in the plugin installation command by choosing the correct option.
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin [1] --deploy
The plugin name git should be specified directly without extra flags.
Fill both blanks to create a Jenkins pipeline step that uses a plugin to build a Docker image.
pipeline {
agent any
stages {
stage('Build') {
steps {
[1] '[2]'
}
}
}
}The docker.build step builds a Docker image named my-image:latest.
Fill all three blanks to define a Jenkins pipeline that uses the Git plugin to clone a repository and then runs a shell command.
pipeline {
agent any
stages {
stage('Checkout') {
steps {
[1] '[2]'
}
}
stage('Build') {
steps {
[3] 'make build'
}
}
}
}The git step clones the repository URL, and sh runs the shell command.