discourse-code-review 추가 시 간헐적으로 CMake 누락

이 문제는 ERROR: CMake is required to build Rugged 와 비슷해 보이지만, 다음 코드를 실행하지 않으면 부트스트랩이 실패했습니다.

  before_code:
    - exec:
        cd: $home
        cmd:
          - apt update
          - apt -y install cmake

아래와 같이 실패했습니다.

I, [2020-06-22T17:13:16.381492 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'    
ERROR:  Error installing rugged:
        ERROR: Failed to build gem native extension.            
                                                                                                           
    current directory: /var/www/discourse/plugins/discourse-code-review/gems/2.6.5/gems/rugged-0.28.4.1/ext/rugged
/usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200622-21455-f9skgp.rb extconf.rb
checking for gmake... no                
checking for make... yes
checking for cmake... no
ERROR: CMake is required to build Rugged.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/$(RUBY_BASE_NAME)
        --with-sha1dc
        --without-sha1dc
        --use-system-libraries

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/www/discourse/plugins/discourse-code-review/gems/2.6.5/extensions/x86_64-linux/2.6.0-static/rugged-0.28.4.1/mkmf.lo
g

extconf failed, exit code 1

하지만 다른 시스템에서는 이 과정 없이도 플러그인을 추가할 수 있었습니다. 두 시스템 모두 상당히 표준적인 web_only.yml을 사용하는데(실패하는 쪽은 쿠버네티스에 배포되고, 정상 작동하는 쪽은 트래픽을 리버스 프록시로 사용하지만, 이것이 부트스트랩 실행 여부에 영향을 미친다고 보기 어렵습니다!).

혹시 제 우회 방법이 다른 사람에게 도움이 되거나, 관련 지식이 있는 분이 변경해야 할 부분을 알아채실 수 있기를 바라며 이 글을 남깁니다.

최신 이미지에 이미 cmake가 설치되어 있습니다. 오래된 이미지를 사용 중인가요? 다시 빌드하면 업데이트됩니다.

아하. rebuild는 업데이트를 수행하지만 bootstrap은 그렇지 않군요. 그리고 다른 시스템에서는 최근 더 자주 rebuild를 실행했었네요. 그 이유를 설명해 주네요. 이제 bootstrap이 git pull을 수행하고 있는지 다시 확인해야 할 것 같습니다.