Deployinator1.0.2版本的bug

来源:互联网 发布:英雄联盟音乐节知乎 编辑:程序博客网 时间:2024/06/13 01:49


今天按照部署文档安装Deployinator, 完成后最基本的test_stack都无法运行, 运行时报错误:

There was an error deploying. Please try again in a moment or there is already a deploy going


重复安装死活不行,只好去跟代码了,发现居然是本身的bug,bug,bug。

尼玛我下的是稳定版啊,怎么能出这种根本不能正常运行的bug?


出bug的代码在:

./vendor/bundle/ruby/1.9.1/bundler/gems/deployinator-140e6502636a/lib/deployinator/helpers/deploy.rb

或者可以搜索:is_deploy_active,这个函数原代码如下:

      def is_deploy_active?(stack, stage)
          if deployname = get_deploy_process_title(stack,stage)
            return system("pgrep -f '#{deployname}'")
          end
          false
        end

其中system("pgrep -f '#{deployname}'")是判断当前有没有发布正在进行,但是这个逻辑写反了,在ubuntu系统上,如果成功执行(找到了进程),system会返回0,即false;找不到进程的时候返回1,即ture,所以将结果进行‘非’操作后即可。

0 0
原创粉丝点击