ci: extract git cleanup to separate script

It needs to be separate script, because once the submodules are broken
and the `variables.mk` file is not available from `nimbus-build-system`
then we cannot even call `make clean-git` successfully because it will
be caught by the `if` clause that checks for `variables.mk`.

Possible fix for issues with submodules not being updated in some
windows release builds.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-11-22 13:40:45 +01:00
parent 6c0806c2e1
commit ff9c678a1e
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
9 changed files with 13 additions and 10 deletions

View File

@ -612,9 +612,7 @@ clean: | clean-common
+ $(MAKE) -C vendor/DOtherSide/build --no-print-directory clean
clean-git:
git clean -qfdx
git submodule foreach --recursive git reset -q --hard
git submodule foreach --recursive git clean -qfdx
./scripts/clean-git.sh
force-rebuild-status-go:
bash ./scripts/force-rebuild-status-go.sh $(STATUSGO)

View File

@ -94,6 +94,6 @@ pipeline {
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
cleanup { sh 'make clean-git' }
cleanup { sh './scripts/clean-git.sh' }
}
}

View File

@ -85,6 +85,6 @@ pipeline {
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
cleanup { sh 'make clean-git' }
cleanup { sh './scripts/clean-git.sh' }
}
}

View File

@ -106,6 +106,6 @@ pipeline {
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
cleanup { sh 'make clean-git' }
cleanup { sh './scripts/clean-git.sh' }
}
}

View File

@ -77,6 +77,6 @@ pipeline {
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
cleanup { sh 'make clean-git' }
cleanup { sh './scripts/clean-git.sh' }
}
}

View File

@ -144,6 +144,6 @@ pipeline {
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
cleanup { sh 'make clean-git' }
cleanup { sh './scripts/clean-git.sh' }
}
}

View File

@ -97,6 +97,6 @@ pipeline {
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
cleanup { sh 'make clean-git' }
cleanup { sh './scripts/clean-git.sh' }
}
}

View File

@ -78,6 +78,6 @@ pipeline {
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
cleanup { sh 'make clean-git' }
cleanup { sh './scripts/clean-git.sh' }
}
}

5
scripts/clean-git.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Extracted from Makefile to avoid nimbus-build-system blocking use.
git clean -qfdx
git submodule foreach --recursive git reset -q --hard
git submodule foreach --recursive git clean -qfdx