如何在git commit上运行shell脚本

用户名

1)

我有一个shell脚本,它基本上包含一些(数据库测试和集成测试代码),

但是我必须在git repo中有提交(或任何更改)时运行此shell脚本,脚本应该执行如何实现此目的

os。Debian 6.0.1 Amazon EC2

我正在尝试像Travis这样的东西来继续集成..

2)

用于Debian之类的OS中的GUI测试,它是更好的selenium或casper.js

还是其他更好的选择

所以请帮帮我

不是

作为第一个问题的答案:您想使用git-hooks。在存储库服务器上,浏览到裸露的git repo目录并修改hooks/post-commit文件(并使用使其可执行chmod +x hooks/post-commit)。

#!/bin/bash

read oldrev newrev refname
## Debugging stuff
#echo "Old revision: $oldrev" >> /home/git/push_log.txt
#echo "New revision: $newrev" >> /home/git/push_log.txt
#echo "Reference name: -${refname}-" >> /home/git/push_log.txt

command_line_script__or_command_to_run_travis_integration.sh

每当您在存储库中提交时,这将启动脚本。有很多不同种类的钩子,这些钩子都记录在中man githooks也许您还想看看post-receive,只要您将它推送到存储库,它将运行脚本。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章