Skip to content

Instantly share code, notes, and snippets.

@futoase
Created September 26, 2014 08:32
Show Gist options
  • Select an option

  • Save futoase/34fa11386269598e1a71 to your computer and use it in GitHub Desktop.

Select an option

Save futoase/34fa11386269598e1a71 to your computer and use it in GitHub Desktop.
なぜなのだろうか

jenkins-cli.jarでpluginのID名で指定するとインストールができない。

plugin ID を指定しただけ

jenkins-cli.jarに渡している引数は以下のとおり。

java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar
 -s http://localhost:8080 install-plugin hipchat

実行結果(3回ほど実行した)

failed: [github-pr-01.local] => (item=hipchat) => {"changed": true, "cmd[7/1850]
a", "-jar", "/var/cache/jenkins/war/WEB-INF/jenkins-cli.jar", "-s", "http://loca
lhost:8080", "install-plugin", "hipchat"], "delta": "0:00:00.834649", "end": "20
14-09-26 17:07:16.619423", "item": "hipchat", "rc": 1, "start": "2014-09-26 17:0
7:15.784774"}
stdout: hipchat is neither a valid file, URL, nor a plugin artifact name in the 
update center
No update center data is retrieved yet from: http://updates.jenkins-ci.org/update-center.json
hipchat looks like a short plugin name. Did you mean ‘null’?
failed: [github-pr-01.local] => (item=ansicolor) => {"changed": true, "cmd": ["$ava", "-jar", "/var/cache/jenkins/war/WEB-INF/jenkins-cli.jar", "-s", "http://l$calhost:8080", "install-plugin", "ansicolor"], "delta": "0:00:00.827157", "end"$ "2014-09-26 17:07:17.733692", "item": "ansicolor", "rc": 1, "start": "2014-09-$6 17:07:16.906535"}
stdout: ansicolor is neither a valid file, URL, nor a plugin artifact name in t$e update center
No update center data is retrieved yet from: http://updates.jenkins-ci.org/upda$e-center.json
ansicolor looks like a short plugin name. Did you mean ‘null’?

hpiファイルを指定してあげる

すると、jenkins-cli.jarはインストールを通る (ansibleを利用してインストールしている)

が、jenkinsのplugin一覧にはインストール済みには出てこない。

changed: [github-pr-01.local] => (item=http://updates.jenkins-ci.org/download/p$ugins/ghprb/1.16-0/ghprb.hpi)
changed: [github-pr-01.local] => (item=http://updates.jenkins-ci.org/download/p$ugins/rvm/0.4/rvm.hpi)
changed: [github-pr-01.local] => (item=http://updates.jenkins-ci.org/download/p$ugins/hipchat/0.1.8/hipchat.hpi)
changed: [github-pr-01.local] => (item=http://updates.jenkins-ci.org/download/p$ugins/ansicolor/0.4.0/ansicolor.hpi)

再度、plugin IDを指定するようにする

すると、jenkins plugin一覧にインストール済みのものとして出てくる。 キャッシュなのかなあ。なんなのだろう。hipchat pluginはインストールできてたりする。 jenkins-cli.jarを使うのはレシピ化できるから便利だなーと思っていたのだけど。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment