Yii Framework Forum: Git Id Commit In The Footer - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Git Id Commit In The Footer Industrialize your app with simple component GitBuildNumberComponent Rate Topic: -----

#1 User is offline   yevgune 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-January 13

Posted 28 January 2013 - 04:01 AM

Hello,

This forum post will be useful for those people who use Git as SCM for the project, If you don't
, so there is one more reason to discover and use Git ;)

Did you have the situation when you needed to know exactly what the version of your app is deployed into the production?

Personally, the most simple and powerful approach is using the git id and last commit time in the footer.

In Yii you can do it by installing simple component GitBuildNumberComponent

The screenshot below demonstrates what does this component:
Posted Image

Installation

Copy the GitBuildNumberComponent.php file to your webapp /protected/components/ folder.
wget https://github.com/yev/yiiGitBuildNumber/blob/master/src/GitBuildNumberComponent.php


Configuration instruction

After downloading and installing the component into right place you have to tell yii framework about tne new component:

1. Edit your webapp
/protected/config/main.php 
file
2. And add the following somewhere in the components section -
'git'=>array( 'class'=>'GitBuildNumberComponent', )

3. After this modification your
protected/config/main.php
file may looks like this:
Posted Image

Using scenario example:
Posted Image


If you are interested in the component history and motivation you can find some information in my blog entry
2

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users