4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

deployerでどのコミットがデプロイされているか確認する

Posted at

最近deployerを使い始めました。
手動でdeployしていると、どのコミットがデプロイされているのか把握できなくなる事がたまにあります。
(cricleci経由でデプロイする仕組みいれてればこのような事になりませんが・・・)

Deployerで気軽に確認したいなーと思ったので、作ってみました。

// deploy.php

...

task('version:check', function(){
    cd('{{release_path}}');
    writeln('<info>release:' . run('pwd | awk -F "/" \'{ print $NF }\''). '</info>');
    writeln(run('git log -n 1'));
});

deploy.phpのタスクに追加するだけえ、どのコミットがdeployされているか確認できます。
gitのログ以外にリリース番号?も表示するようにしています。

deployerについてそんなに調べてないので、
もっとよいレシピとか方法を知っている方いたら教えてください・・・。

最後に

taskについて勘違いしてたツイートに@nunulkさんからリプライもらえて助かりました!!

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?