From 9e86b009686fa45794198734c614d1fbe77e9aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 29 May 2018 15:56:45 -0300 Subject: [PATCH 1/7] Clean backup poms after release --- do-release.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/do-release.sh b/do-release.sh index 0f8f4715f0..059a8fa885 100755 --- a/do-release.sh +++ b/do-release.sh @@ -161,6 +161,7 @@ EOF echo echo "Press enter to continue..." read +./mvwn release:clean git commit -a -m "Prepare next development version" git push origin ${CURRENT_BRANCH} echo From 32c34d43cb70d5b8daed0bde6088aa5c520c0167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 29 May 2018 16:08:48 -0300 Subject: [PATCH 2/7] Automatically reset the release notes --- do-release.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/do-release.sh b/do-release.sh index 059a8fa885..f6d08edc7a 100755 --- a/do-release.sh +++ b/do-release.sh @@ -127,9 +127,13 @@ echo echo "Prepare Next development version:" echo "* Move version/release info from **docs/pages/release_notes.md** to **docs/pages/release_notes_old.md**." echo "* Update version/date info in **docs/_config.yml**." -echo "* Update version/release info in **docs/pages/release_notes.md**." echo -cat < docs/pages/release_notes.md < Date: Tue, 29 May 2018 16:43:58 -0300 Subject: [PATCH 3/7] Run in batch mode --- do-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/do-release.sh b/do-release.sh index f6d08edc7a..6f305aa1ed 100755 --- a/do-release.sh +++ b/do-release.sh @@ -163,9 +163,9 @@ This is a minor release. EOF -./mvwn release:clean git commit -a -m "Prepare next development version" git push origin ${CURRENT_BRANCH} +./mvwn -B release:clean echo echo echo From 59d7834df180ca2d9b4ed7ebf8d191ba89fd1967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 29 May 2018 16:55:12 -0300 Subject: [PATCH 4/7] Fix release ruleset name --- do-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/do-release.sh b/do-release.sh index 6f305aa1ed..b68bf118a5 100755 --- a/do-release.sh +++ b/do-release.sh @@ -73,7 +73,7 @@ echo echo "* Update date info in **docs/_config.yml**." echo echo "* Ensure all the new rules are listed in a the proper file:" -echo " pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION}.xml file." +echo " pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml file." echo echo "* Update **../pmd.github.io/_config.yml** to mention the new release" echo From d333cc87bee19c1ae030fb263e3ee68967c66843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 29 May 2018 17:11:40 -0300 Subject: [PATCH 5/7] Make sure to include the release ruleset if necessary --- do-release.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/do-release.sh b/do-release.sh index b68bf118a5..3e00bb432f 100755 --- a/do-release.sh +++ b/do-release.sh @@ -82,6 +82,11 @@ echo echo "Press enter to continue..." read echo "Committing current changes (pmd)" + +if [[ -e pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml ]] + git add pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml +fi + git commit -a -m "Prepare pmd release ${RELEASE_VERSION}" ( echo "Committing current changes (pmd.github.io)" From e3065c388ea7c4391cb9bea7c4f973dd504e2dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 29 May 2018 17:42:27 -0300 Subject: [PATCH 6/7] Automatically update release_notes_old.md --- do-release.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/do-release.sh b/do-release.sh index 3e00bb432f..00c13cd8ce 100755 --- a/do-release.sh +++ b/do-release.sh @@ -128,15 +128,20 @@ echo " --> move any open issues to the next milestone, close the current milesto echo " --> Maybe there are some milestones on sourceforge, too: ." echo echo -echo echo "Prepare Next development version:" -echo "* Move version/release info from **docs/pages/release_notes.md** to **docs/pages/release_notes_old.md**." echo "* Update version/date info in **docs/_config.yml**." echo echo echo "Press enter to continue..." read +# update release_notes_old +OLD_RELEASE_NOTES=$(tail -n +5 docs/pages/release_notes_old.md) +NEW_RELEASE_NOTES=$(tail -n +6 docs/pages/release_notes.md) +echo "$(head -n 5 docs/pages/release_notes_old.md)" > docs/pages/release_notes_old.md +echo "$NEW_RELEASE_NOTES" >> docs/pages/release_notes_old.md +echo "$OLD_RELEASE_NOTES" >> docs/pages/release_notes_old.md + # reset release notes template cat > docs/pages/release_notes.md < Date: Wed, 30 May 2018 09:01:00 +0200 Subject: [PATCH 7/7] Minor tweaks for release script: RELEASE_RULESET var and more header lines for release_notes_old.md --- do-release.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/do-release.sh b/do-release.sh index 00c13cd8ce..da54a0095f 100755 --- a/do-release.sh +++ b/do-release.sh @@ -66,6 +66,8 @@ export RELEASE_VERSION export DEVELOPMENT_VERSION export CURRENT_BRANCH +RELEASE_RULESET="pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml" + echo "* Update version/release info in **docs/pages/release_notes.md**." echo echo " ## $(date -u +%d-%B-%Y) - ${RELEASE_VERSION}" @@ -73,7 +75,7 @@ echo echo "* Update date info in **docs/_config.yml**." echo echo "* Ensure all the new rules are listed in a the proper file:" -echo " pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml file." +echo " ${RELEASE_RULESET}" echo echo "* Update **../pmd.github.io/_config.yml** to mention the new release" echo @@ -83,8 +85,9 @@ echo "Press enter to continue..." read echo "Committing current changes (pmd)" -if [[ -e pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml ]] - git add pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml +if [[ -e ${RELEASE_RULESET} ]] +then + git add ${RELEASE_RULESET} fi git commit -a -m "Prepare pmd release ${RELEASE_VERSION}" @@ -136,10 +139,11 @@ echo "Press enter to continue..." read # update release_notes_old -OLD_RELEASE_NOTES=$(tail -n +5 docs/pages/release_notes_old.md) +OLD_RELEASE_NOTES=$(tail -n +8 docs/pages/release_notes_old.md) NEW_RELEASE_NOTES=$(tail -n +6 docs/pages/release_notes.md) -echo "$(head -n 5 docs/pages/release_notes_old.md)" > docs/pages/release_notes_old.md +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 echo "$OLD_RELEASE_NOTES" >> docs/pages/release_notes_old.md # reset release notes template