Created
February 2, 2023 20:10
-
-
Save imoutsatsos/123a23333c632ff19797e8cc376a39a1 to your computer and use it in GitHub Desktop.
PowerShell script uses jenkins-cli to install multiple Jenkins plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#An example PowerShell build step of how to use jenkins-cli to install multiple Jenkins plugins | |
$condition = 'true' | |
$setupBase='D:\SERVER_SETUP\JENKINS' #Path to jenkins-cli.jar file | |
# A space separated list of Jenkins plugins to install, using their short names | |
$missing= 'jenkins-multijob-plugin parameterized-trigger' -split ' ' | |
$USER_NAME='ioannis' | |
$JENKINS_API_TOKEN='blahblah' | |
if ( $condition -like 'true' ) | |
{ | |
Write-Output "Build will try to install Missing Plugins" | |
java -jar $setupBase\jenkins-cli.jar -s $JENKINS_URL -auth $USER_NAME:$JENKINS_API_TOKEN install-plugin $missing | |
}else{ | |
Write-Output "Please, install required plugins manually" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment