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:
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:
- Edit your webapp
/protected/config/main.php
file
- And add the following somewhere in the components section -
'git'=>array( 'class'=>'GitBuildNumberComponent', )
- After this modification your
protected/config/main.php
file may looks like this:
Using scenario example:
If you are interested in the component history and motivation you can find some information in my blog entry