Cache bundles on travis, use bundle exec

This commit is contained in:
Andreas Dangel
2018-08-17 10:41:32 +02:00
parent 43a21997d9
commit eb03003f66
6 changed files with 17 additions and 6 deletions

2
.gitignore vendored
View File

@ -11,3 +11,5 @@ bin/
*.patch
*/src/site/site.xml
pmd-core/dependency-reduced-pom.xml
.bundle
vendor

View File

@ -34,7 +34,7 @@ before_install:
# Install OracleJDK 10 - see https://sormuras.github.io/blog/2018-03-20-jdk-matrix.html
install:
- . ./install-jdk.sh -F 10 -L BCL
- bundle install
- bundle install --without=release_notes_preprocessing
before_script: true
script: source .travis/build-$BUILD.sh
after_success: true
@ -71,6 +71,7 @@ notifications:
cache:
directories:
- "$HOME/.m2"
- vendor/bundle
# Secure Keys, that need to be set for snapshot builds

View File

@ -28,8 +28,11 @@ if [ "${BUILD}" = "deploy" ]; then
true
)
# install the gems required for rendering the release notes
bundle install --with=release_notes_preprocessing
# renders, and skips the first 6 lines - the Jekyll front-matter
RENDERED_RELEASE_NOTES=$(.travis/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
RENDERED_RELEASE_NOTES=$(bundle exec .travis/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
# Assumes, the release has already been created by travis github releases provider
RELEASE_ID=$(curl -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" https://api.github.com/repos/pmd/pmd/releases/tags/pmd_releases/${RELEASE_VERSION}|jq ".id")

View File

@ -15,6 +15,9 @@ require "safe_yaml"
require_relative "../docs/_plugins/rule_tag"
require_relative "../docs/_plugins/custom_filters"
# explicitly setting safe mode to get rid of the warning
SafeYAML::OPTIONS[:default_mode] = :safe
# START OF THE SCRIPT
unless ARGV.length == 1 && File.exists?(ARGV[0])

View File

@ -3,9 +3,7 @@ source 'https://rubygems.org/'
gem 'pmdtester', '~> 1.0.0.pre.beta3'
gem 'danger', '~> 5.6', '>= 5.6'
# I think we could skip installing these if we're not a release build
# https://docs.travis-ci.com/user/languages/ruby/#speeding-up-your-build-by-excluding-non-essential-dependencies
# I don't know where to put that in .travis.yml though...
# This group is only needed during release (via .travis/release.sh and do-release.sh)
group :release_notes_preprocessing do
gem 'liquid', '>=4.0.0'
gem 'safe_yaml', '>=1.0'

View File

@ -62,6 +62,10 @@ echo "Press enter to continue..."
read
# install bundles needed for rendering release notes
bundle install with=release_notes_preprocessing --path vendor/bundle
export RELEASE_VERSION
export DEVELOPMENT_VERSION
export CURRENT_BRANCH
@ -137,7 +141,7 @@ read
# update release_notes_old
OLD_RELEASE_NOTES=$(tail -n +8 docs/pages/release_notes_old.md)
NEW_RELEASE_NOTES=$(.travis/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
NEW_RELEASE_NOTES=$(bundle exec .travis/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
echo "$(head -n 7 docs/pages/release_notes_old.md)" > docs/pages/release_notes_old.md
echo "$NEW_RELEASE_NOTES" >> docs/pages/release_notes_old.md
echo >> docs/pages/release_notes_old.md