Gitlab-运行ner 运行太长了

Gitlab-runner run too long

我创建了一个静态站点,现在正在尝试配置 GitLab CI/CD。

站点的源代码在远程服务器上。

这是我的gitlab-ci.yml

image: ruby:2.6


variables:
  JEKYLL_ENV: production

before_script:
  - gem install bundler
  - bundle install

deploy:
  stage: deploy
  script:
  - bundle exec jekyll build --watch 

  only:
    - master

我使用--watch因为没有使用正确传递的--watch作业,更改显示在本地计算机上,但没有更新显示在远程服务器上。

答案中有一行:

Auto-regeneration: disabled for '/ builds / wiki / docplus'. Use --watch to enable

但是 --watch 我推送我的提交并且 gitlab-runner 运行时间太长并且作业失败

$ bundle exec jekyll build --watch
Configuration file: /builds/wiki/docplus/_config.yml
            Source: /builds/wiki/docplus
       Destination: /builds/wiki/docplus/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 1.863 seconds.
 Auto-regeneration: enabled for '/builds/wiki/docplus'
Pulling docker image gitlab/gitlab-runner-helper:x86_64-003fe500 ...
ERROR: Job failed: execution took longer than 1h0m0s seconds

怎么了?

将您的 deploy.script 更新为仅 build(没有 --watch):

deploy:
  stage: deploy
  script:
  - bundle exec jekyll build