[英]GitLab CI ..gitlab-ci.yml property to use fors static page
我正在使用GitLab托管我的静态页面! 每次配置.gitlab-ci.yml文件时,都会出现以下错误:“无法找到Gemfile”
此处是.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
在您的配置中,我看到了混合的不同安装说明:
bundle install
(在before_script中) bundle install
(同样,在页面部署脚本中) gem install jekyll
bundle
命令需要Gemfile
,它应主要指定对Gemfile
的依赖关系(因此也是重复项)
建议的解决方案 :我建议您尝试使用gitlab页面示例中的配置:
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
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.