2017-09-28 2 views
0

J'utilise GitLab pour héberger ma page statique! chaque fois que je suis la configuration du fichier .gitlab-ci.yml Je reçois l'erreur suivante: « Impossible de localiser Gemfile »GitLab CI ..gitlab-ci.yml propriété à utiliser fors page statique

est ici la sortie du cmd enter image description here

ici id le .gitlab- ci.yml fichier

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

Vous devez passer la construction comme un artefact. –

+0

@JakubKania Comment cela a-t-il pu être fait? –

Répondre

1

Dans votre configuration, je vois un mélange de différentes instructions d'installation:

  • bundle install (dans le before_script)
  • bundle install (encore une fois, dans les pages déployer le script)
  • gem install jekyll

Le Gemfile est requis par la commande bundle, et il devrait préciser principalement la dépendance à l'égard jekyll (à nouveau une duplication)

PROPOSÉ SOLUTION: je vous suggère d'essayer avec la configuration dans le gitlab pages sample:

  • -ci.yml gitlab ce

    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]