Fix release scripts

* fix language var LANG
* fix bundle install command
* automate creation of release notes post in pmd.github.io
* add var "is_release_notes_processor"
* Always install the gems for rendering release notes
This commit is contained in:
Andreas Dangel 2018-09-02 14:51:23 +02:00
parent 65a3e1a3f7
commit 848a0761fe
7 changed files with 18 additions and 19 deletions

View File

@ -52,7 +52,7 @@ before_install:
install:
- . ./install-jdk.sh -F 11 -L GPL -W $HOME/jdk
- gem install bundler
- bundle install --without=release_notes_preprocessing
- bundle install --with=release_notes_preprocessing
before_script: true
script: source .travis/build-$BUILD.sh
after_success: true

View File

@ -4,7 +4,7 @@ set -e
source .travis/logger.sh
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
log_info "Building PMD Coveralls.io report ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then

View File

@ -4,7 +4,7 @@ set -e
source .travis/logger.sh
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
log_info "Building PMD Documentation ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then

View File

@ -4,7 +4,7 @@ set -e
source .travis/logger.sh
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
log_info "Building PMD Sonar ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then

View File

@ -28,9 +28,6 @@ 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=$(bundle exec .travis/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)

View File

@ -3,7 +3,9 @@ source 'https://rubygems.org/'
gem 'pmdtester', '~> 1.0.0.pre.beta3'
gem 'danger', '~> 5.6', '>= 5.6'
# This group is only needed during release (via .travis/release.sh and do-release.sh)
# This group is only needed for rendering release notes
# this happens during release (.travis/release.sh and do-release.sh)
# but also during regular builds (.travis/build-deploy.sh)
group :release_notes_preprocessing do
gem 'liquid', '>=4.0.0'
gem 'safe_yaml', '>=1.0'

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Make sure, everything is English...
export LANG=C.UTF8
export LANG=C.UTF-8
# verify the current directory
if [ ! -f pom.xml -o ! -d ../pmd.github.io ]; then
@ -62,15 +62,19 @@ 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
# install bundles needed for rendering release notes
bundle install --with=release_notes_preprocessing --path vendor/bundle
RELEASE_RULESET="pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml"
export RELEASE_NOTES_POST="_posts/$(date -u +%Y-%m-%d)-PMD-${RELEASE_VERSION}.md"
echo "Generating ../pmd.github.io/${RELEASE_NOTES_POST}..."
NEW_RELEASE_NOTES=$(bundle exec .travis/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
echo "${NEW_RELEASE_NOTES}" > ../pmd.github.io/${RELEASE_NOTES_POST}
echo "* Update date info in **docs/_config.yml**."
echo " date: $(date -u +%d-%B-%Y)"
@ -80,8 +84,6 @@ echo " ${RELEASE_RULESET}"
echo
echo "* Update **../pmd.github.io/_config.yml** to mention the new release"
echo
echo "* Add **../pmd.github.io/_posts/$(date -u +%Y-%m-%d)-PMD-${RELEASE_VERSION}.md"
echo
echo "Press enter to continue..."
read
echo "Committing current changes (pmd)"
@ -95,7 +97,7 @@ git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
(
echo "Committing current changes (pmd.github.io)"
cd ../pmd.github.io
git add _posts/$(date -u +%Y-%m-%d)-PMD-${RELEASE_VERSION}.md
git add ${RELEASE_NOTES_POST}
git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
git push
)
@ -117,7 +119,6 @@ echo
echo "Check the milestone on github:"
echo "<https://github.com/pmd/pmd/milestones>"
echo " --> move any open issues to the next milestone, close the current milestone"
echo " --> Maybe there are some milestones on sourceforge, too: <https://sourceforge.net/p/pmd/bugs/milestones>."
echo
echo
echo "Prepare Next development version:"
@ -129,7 +130,6 @@ read
# update release_notes_old
OLD_RELEASE_NOTES=$(tail -n +8 docs/pages/release_notes_old.md)
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
@ -149,7 +149,7 @@ The PMD team is pleased to announce PMD {{ site.pmd.version }}.
This is a {{ site.pmd.release_type }} release.
{% tocmaker %}
{% tocmaker is_release_notes_processor %}
### New and noteworthy