びみょーに難しいプラグインのリリース方法
滅多にやらないから覚えられない(といっても前回んときは、2008年でjava.netだったし)。まだ、うまく行った気がしないけど、Emotional Jenkinsをどうやったか残しておく。
間違ってたら教えてください。> 有識者の方々。m(_ _)m
#(追記)更新に時間かかるらしく、やっとプラグインマネージャから入手できるようになりました。
以下、やったこと。の前に前提条件として、Githubのアカウントは持ってて、ついでにjenkinsciのメンバでもある(Everyoneだけど)。そんでもって、jenkins-ci.orgのアカウントも持ってるよ。って事で話を進める。
あと、この辺参考にしてます。
→ https://wiki.jenkins-ci.org/display/JENKINS/Hosting+Plugins
■Githubの自分のプロジェクトとしてプラグインのリポジトリを作る
Everyoneではjenkinsciに新しいリポジトリを作れないので、とりあえず自分とこに作る。
→ https://github.com/masanobuimai/emotional-jenkins-plugin
■作ったリポジトリをjenkinsciにforkさせる
jenkinsciのOwnerにリポジトリ作ってもらうのが正しいやり方っぽい。id:kiy0taka さんに裏技教えてもらったので、それでjenkinsciにforkした。やり方は以下の通り。
- 適当なIRCクライアント用意する
- ホスト:irc.freenode.net, チャネル:#jenkins でIRCチャットに参加
- こんなメッセージを送る
- jenkins-admin:Fork masanobuimai/emotional-jenkins-plugin on github
これでJenkinsのIRC Botがjenkinsciに指定したリポジトリをforkしてくれる。
→ https://wiki.jenkins-ci.org/display/JENKINS/IRC+Bot
■jenkins-ci.orgにプラグインのWikiページを作る
こんなの。
→ https://wiki.jenkins-ci.org/display/JENKINS/Emotional+Jenkins+Plugin
ポイントは、
- {jenkins-plugin-info:pluginId=your-artifact} を書くこと
- Wikiページのラベルにプラグインのカテゴリを指定すること
- んでもって、プラグインのpom.xmlのurlタグにもそのURL書いておく
あたりかと(ホントかどうかは知らない。:-)
■プラグインをリリースする
最後のアップロードでこける("HTTP 401 when transferring a file to the Jenkins Maven repository"になる)場合は、~/.m2/settings.xmlに jenkins-ci.org のアカウント情報書いておくといいよ。
<servers> <server> <id>maven.jenkins-ci.org</id> <username>yourname</username> <password>yourpassword</password> </server> </servers>
あと、プロジェクトのホームディレクトリ(要するにpom.xmlあるところ)で、こんなコマンド叩く。
$ mvn release:prepare release:perform
何回かgithubのパスワード聞かれるから、間違えずに答えよう(間違ったら、カレントディレクトリにできる release.properties 消したり、中途半端にコミットされた pom.xml を戻して再チャレンジするといいよ。
以上、ここまで。一応、maven.jenkins-ci.orgに*.hpi はアップロードできたんだけど、未だにJenkinsのプラグインマネージャからは見えないし、ci.jenkins-ci.orgにも出てこないし、Wikiのプラグイン情報も更新されない。:-(
うーむ、何を見落したんだ???
(追記) 単に反映まで時間がかかるみたいですね。プラグインマネージャが見てる update-center.jsonは6時間おきに更新するんだと。
Hosting Plugins - Jenkins - Jenkins WikiHelp! My plugin is not showing up in the update center.
- First, check http://maven.jenkins-ci.org/content/repositories/releases/ and see if your plugin is listed there (under org/jenkins-ci/plugins/ or org/jvnet/hudson/plugins/). If not, your release process failed, and it never left your PC. If you can't resolve this issue, capture the output from mvn release:prepare release:perform and send it to the dev list.
- Check if your new version is in http://updates.jenkins-ci.org/update-center.json. This file is updated every 6 hours, so there's some delay before your new version appears here.
- If your plugin appears there but not in your Jenkins update center, visit Manage Plugins / Advanced and click the button to make Jenkins retrieve the latest update-center.json data.
- If none above applies, it's time for Kohsuke to start investigating.
アップデートセンターのJSONが更新されてもJenkinsのプラグインマネージャに出てこない場合は、$JENKINS_HOME/updates/default.json を消してJenkinsを再起動するといいかもダ。
んで、JSONが更新されるとWikiページのプラグイン情報も取得可能になるみたい。