Last active
March 8, 2017 00:43
-
-
Save 7rin0/c8c9311bdd91c251c502fb983da840a8 to your computer and use it in GitHub Desktop.
From Jenkins CLI Plugin export to Docker Jenkins plugin-install.sh
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
#!/bin/bash | |
# Not recommended way. | |
# java -jar jenkins-cli.jar -s http://localhost:8080/ list-plugins | sed 's/\s\s+*/#/g' | tr -s '#' | sed 's/#.*#/:/g' | tr -d ' ' > plugins.txt | |
# cat plugins.list |tr -s ' ' | sed 's/\s.*\s/:/g' | sed 's/:[^0-9].*//g' | |
# Export to expected format by install-plugins.sh | |
java -jar jenkins-cli.jar -s http://localhost:8080/ list-plugins | tr -s ' ' | sed 's/\s.*\s/:/g' | sed 's/:[^0-9].*//g' > plugins.txt | |
# Install from default Jenkins cli export | |
install-plugins.sh $(cat plugins.list | tr -s ' ' | sed 's/\s.*\s/:/g' | sed 's/:[^0-9].*//g') | |
# Install from pre-formatted list | |
install-plugins.sh plugins.list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment