关于jenkins、gitlab的持续交付

1、gitlab 支持webhooks 和 integrations 两种方式进行支持持续部署的

 2、webhooks 里面一般是方便对接自己部署的url ,进行触发特定的行为。gitlab会通过post 的方式回调填充的url (可在test->detail 中看到请求参数和响应参数。并且此url 不支持在url 中拼接参数)。

3、integrations  内部集成了jenkins等一大批工具。用户只需要输入用户名密码等,连接上自己部署的对应的工具,即可触发特定的行为。

以jenkins 端设置为例:只需要在jenkins 中新建项目中的配置中,打几个勾即可。

 4、gitlab webhooks 的配置项更多一些。比如 只触发branch 分支的push事件等。

 5、git pull 自动脚本:

>>>>$ cat gitpull.exp 
#!/usr/bin/expect
set user [lindex $argv 0]
set password [lindex $argv 1]
set timeout 10

spawn git pull --no-edit
expect "Username*"
send "$user\n"
expect "Password*"
send "$password\n"
expect eof

>>>> expect  gitpull.exp username  passwd

  

原文地址:https://www.cnblogs.com/xunhanliu/p/15695680.html