简体   繁体   English

GitLab CI ..gitlab-ci.yml属性用于fors静态页面

[英]GitLab CI ..gitlab-ci.yml property to use fors static page

I am using GitLab to host my static page! 我正在使用GitLab托管我的静态页面! every time I am configuring the .gitlab-ci.yml file I am getting the following error: "Could not locate Gemfile" 每次配置.gitlab-ci.yml文件时,都会出现以下错误:“无法找到Gemfile”

Here is the output of the cmd 这是cmd的输出 在此处输入图片说明

Here id the .gitlab-ci.yml file 此处是.gitlab-ci.yml文件

image: ruby:2.3


before_script:
- bundle install

job:
  script:
  - gem install jekyll
  - jekyll build

pages:
  stage: deploy
  script:
  - bundle install
  - bundle exec jekyll build -d public
  artifacts:
    paths:
    - public
  only:
  - master

test:
  stage: test
  script:
  - bundle install
  - bundle exec jekyll build -d test
  artifacts:
    paths:
    - test
  except:
  - master

In your configuration I see a mixed of different install instructions: 在您的配置中,我看到了混合的不同安装说明:

  • bundle install (in the before_script) bundle install (在before_script中)
  • bundle install (again, in the pages deploy script) bundle install (同样,在页面部署脚本中)
  • gem install jekyll

The Gemfile is required by the bundle command, and it should specify mainly the dependency on jekyll (so again a duplication) bundle命令需要Gemfile ,它应主要指定对Gemfile的依赖关系(因此也是重复项)

PROPOSED SOLUTION : I suggest you to try with the configuration in the gitlab pages sample : 建议的解决方案 :我建议您尝试使用gitlab页面示例中的配置:

  • gitlab-ci.yml gitlab-ci.yml

     image: ruby:2.3 variables: JEKYLL_ENV: production before_script: - bundle install test: stage: test script: - bundle exec jekyll build -d test artifacts: paths: - test except: - master pages: stage: deploy script: - bundle exec jekyll build -d public artifacts: paths: - public only: - master 
  • Gemfile 的Gemfile

     source "https://rubygems.org" ruby RUBY_VERSION # This will help ensure the proper Jekyll version is running. gem "jekyll", "3.4.0" # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM