[英]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.