2017-09-28 51 views
0

我正在使用GitLab來託管我的靜態頁面! 我配置.gitlab-ci.yml文件我收到以下錯誤每次:「無法找到的Gemfile」GitLab CI ..gitlab-ci.yml屬性使用fors靜態頁面

這裏是CMD enter image description here

這裏的id .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 
+0

您需要構建通過爲僞影。 –

+0

@JakubKania如何做到這一點? –

回答

1

在你的配置我看到一個混合的不同安裝說明:

  • bundle install(在before_script)
  • bundle install(同樣,在網頁部署腳本)
  • gem install jekyll

Gemfilebundle命令必需的,它應規定主要是對哲基爾的依賴(如此反覆一個重複)

提出的解決方案: 我建議你用在gitlab pages sample配置嘗試:

  • 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]