简体   繁体   中英

Jekyll plugin works locally but not on Travis CI

I've set up my site to build with Travis CI, and added a few plugins.

This is my Gemfile :

source "https://rubygems.org"

group :jekyll_plugins do
    gem "github-pages"
    gem "octopress-minify-html"  # This one does not work on Travis
    gem "jekyll-git_metadata"
    gem "jekyll-paginate-v2"
    gem "jekyll-tagging"
end

And this is my .travis.yml (with irrelevant information stripped)

language: ruby
cache: bundler
sudo: false

#install: use default `bundle install`
script: bundle exec jekyll build
after_success: .travis/deploy.sh

I tried building my site locally:

$ bundle update
$ bundle install
$ bundle exec jekyll build

And I can see the generated HTML files are minified.

But when I check pushed files from Travis CI, the HTML files are not minified. Also judging from build time, the plugin octopress-minify-html is not working (when it's working the build time is significantly longer).

I tried deleting my whole working directory and re-cloning from GitHub and this plugin is still working locally. I deleted Travis CI cache and let Bundler build everything again, but the plugin still doesn't work on Travis.

What went wrong on Travis?

您可以通过在配置文件中设置minify_html: true来强制使用octopress-minify-html进行octopress-minify-html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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