あまり更新していなかった gem ライブラリに p-r がきたので、マージした上で久しぶりにバージョンアップ & リリースした際のメモ。
リポジトリをもってくる
ギットクローン。
$ git clone https://github.com/tily/ace-client-ext.git
Cloning into 'ace-client-ext'...
remote: Counting objects: 145, done.
remote: Total 145 (delta 0), reused 0 (delta 0), pack-reused 145
Receiving objects: 100% (145/145), 15.56 KiB | 0 bytes/s, done.
Resolving deltas: 100% (40/40), done.
Checking connectivity... done.
作業ディレクトリに移動。
$ cd ace-client-ext/
docker コンテナで作業できるようにする
Dockerfile 作成。
$ vi Dockerfile
FROM ruby
WORKDIR /work
RUN apt-get update && apt-get install -y vim
ADD Gemfile .
ADD Gemfile.lock .
ADD ace-client-ext.gemspec .
ADD VERSION .
RUN bundle install
docker-compose.yml 作成。
vi docker-compose.yml
version: "2"
services:
lib:
build: .
volumes:
- ./:/work
command: tail -f /dev/null
ドッカーコンポーザップディー。
$ docker-compose up -d
バージョンアップ & リリース
docker コンテナにログイン。
$ docker-compose exec lib bash
git のなまえ・メアド設定。 (この手順は Dockerfile に書いちゃってもいいかな…。)
> git config --global user.email tidnlyam@gmail.com
> git config --global user.name tily
VERSION ファイル編集。 (v0.0.10 -> v0.0.11)
> vi VERSION
> git diff VERSION
diff --git a/VERSION b/VERSION
index 7c1886b..2cfabea 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.0.10
+0.0.11
ギットアッド。
> git add VERSION
ギットコミット。
> git commit -m "version up to 0.0.11"
[master bce0ef3] version up to 0.0.11
1 file changed, 1 insertion(+), 1 deletion(-)
レイクリリース。
> rake release
ace-client-ext 0.0.11 built to pkg/ace-client-ext-0.0.11.gem.
Tagged v0.0.11.
Username for 'https://github.com': tily
Password for 'https://tily@github.com':
Username for 'https://github.com': tily
Password for 'https://tily@github.com':
Pushed git commits and tags.
rake aborted!
Your rubygems.org credentials aren't set. Run `gem push` to set them.
Tasks: TOP => release => release:rubygem_push
(See full trace by running task with --trace)
rake build
/ git tag v0.0.11
/ git push --tags
/ git push origin master
までは成功するが、gem push
するところでこけた。エラーメッセージ通り、手動で gem push してみる。
> gem push pkg/ace-client-ext-0.0.11.gem
Enter your RubyGems.org credentials.
Don't have an account yet? Create one at https://rubygems.org/sign_up
Email: (rubygems.org に登録してるメアド)
Password:
Signed in.
Pushing gem to https://rubygems.org...
Successfully registered gem: ace-client-ext (0.0.11)
正しいメアドとパスワードの組み合わせを忘れてしまっていてあせったけど、なんとか思い出してリリースすることができた。
あとで Dockerfile と docker-compose.yml もコミットしておこう。