For a patch which removes a submodule (project leaving autorelease)
checking out HEAD before autorelease-checkout-gerrit-patch
was causing the project directory be present during verify-autorelease
which could lead to false Verified+1.
Recent example: Removing Yangtools
without updating validate-pom.xml properly.
This change adds forceful clean to autorelease-checkout-gerrit-patch.
The jacoco workaround now has to be applied after such cleaning.
Change-Id: I651a7eaa212835d6cce52ee3706a85f12189f244
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
# If the project is autorelease then we need to init and update submodules
if [ "$GERRIT_PROJECT" == "releng/autorelease" ]; then
git submodule update --init
+ # The previous checkout might have failed to remove directory of a submodule being removed.
+ # See https://stackoverflow.com/a/10761699
+ git clean -dff
fi
- builder:
files: '**/*.xml'
builders:
- - jacoco-nojava-workaround
- autorelease-checkout-gerrit-patch
+ - jacoco-nojava-workaround
- autorelease-generate-release-patches
# In a perfect world projects should be releasing separately and we consume them
# via a project that pulls the release bits from each project from Nexus.