From 38f0973dc3db779375c7a2bc8fc834de58519794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 3 Nov 2022 10:36:47 +0100 Subject: [PATCH] ci: use git clean instead of cleanWs() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a continuation of attempts to fix provlems with Windows CI hosts getting into a broken state due to `.git` directory becoming a file for random submodules for unknown reason. Instead of relying on Jenkins functionality of `cleanWs()` function provided by the [Workspace Cleanup Plugin](https://plugins.jenkins.io/ws-cleanup) we use Git which should be more reliable, and possibly also speed up the initial checkout of the repo and submodules. A nice side-effect is that the repo checkout on all builds after the first one takes ~1 minute instead of ~5 minutes. Previous issues: - https://github.com/status-im/status-desktop/pull/7968 - https://github.com/status-im/status-desktop/pull/8046 Signed-off-by: Jakub SokoĊ‚owski --- Makefile | 4 ++++ ci/Jenkinsfile.linux | 2 +- ci/Jenkinsfile.linux-cpp | 2 +- ci/Jenkinsfile.macos | 2 +- ci/Jenkinsfile.macos-cpp.todo | 2 +- ci/Jenkinsfile.uitests | 2 +- ci/Jenkinsfile.windows | 2 +- ci/Jenkinsfile.windows-cpp.todo | 2 +- 8 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a46c529ee2..d1cbb52d2e 100644 --- a/Makefile +++ b/Makefile @@ -608,6 +608,10 @@ clean: | clean-common rm -rf bin/* node_modules bottles/* pkg/* tmp/* $(STATUSGO) $(STATUSKEYCARDGO) + $(MAKE) -C vendor/DOtherSide/build --no-print-directory clean +clean-git: + git clean -fdx + git submodule foreach --recursive git clean -fdx + force-rebuild-status-go: bash ./scripts/force-rebuild-status-go.sh $(STATUSGO) diff --git a/ci/Jenkinsfile.linux b/ci/Jenkinsfile.linux index 23681c99e4..94a58267af 100644 --- a/ci/Jenkinsfile.linux +++ b/ci/Jenkinsfile.linux @@ -96,6 +96,6 @@ pipeline { post { success { script { github.notifyPR(true) } } failure { script { github.notifyPR(false) } } - cleanup { cleanWs() } + cleanup { sh 'make clean-git' } } } diff --git a/ci/Jenkinsfile.linux-cpp b/ci/Jenkinsfile.linux-cpp index 52a3231a84..545ed1e40f 100644 --- a/ci/Jenkinsfile.linux-cpp +++ b/ci/Jenkinsfile.linux-cpp @@ -85,6 +85,6 @@ pipeline { post { success { script { github.notifyPR(true) } } failure { script { github.notifyPR(false) } } - cleanup { cleanWs() } + cleanup { sh 'make clean-git' } } } diff --git a/ci/Jenkinsfile.macos b/ci/Jenkinsfile.macos index 6d5bd8fb31..2bcfd524f1 100644 --- a/ci/Jenkinsfile.macos +++ b/ci/Jenkinsfile.macos @@ -108,6 +108,6 @@ pipeline { post { success { script { github.notifyPR(true) } } failure { script { github.notifyPR(false) } } - cleanup { cleanWs() } + cleanup { sh 'make clean-git' } } } diff --git a/ci/Jenkinsfile.macos-cpp.todo b/ci/Jenkinsfile.macos-cpp.todo index 34b606f71b..10fce709a6 100644 --- a/ci/Jenkinsfile.macos-cpp.todo +++ b/ci/Jenkinsfile.macos-cpp.todo @@ -77,6 +77,6 @@ pipeline { post { success { script { github.notifyPR(true) } } failure { script { github.notifyPR(false) } } - cleanup { cleanWs() } + cleanup { sh 'make clean-git' } } } diff --git a/ci/Jenkinsfile.uitests b/ci/Jenkinsfile.uitests index 4ffdee48c9..15ba6c6640 100644 --- a/ci/Jenkinsfile.uitests +++ b/ci/Jenkinsfile.uitests @@ -145,6 +145,6 @@ pipeline { post { success { script { github.notifyPR(true) } } failure { script { github.notifyPR(false) } } - cleanup { cleanWs() } + cleanup { sh 'make clean-git' } } } diff --git a/ci/Jenkinsfile.windows b/ci/Jenkinsfile.windows index 91940ff8c0..166616d150 100644 --- a/ci/Jenkinsfile.windows +++ b/ci/Jenkinsfile.windows @@ -99,6 +99,6 @@ pipeline { post { success { script { github.notifyPR(true) } } failure { script { github.notifyPR(false) } } - cleanup { cleanWs(disableDeferredWipeout: true, deleteDirs: true) } + cleanup { sh 'make clean-git' } } } diff --git a/ci/Jenkinsfile.windows-cpp.todo b/ci/Jenkinsfile.windows-cpp.todo index 55f409b33c..f07297e321 100644 --- a/ci/Jenkinsfile.windows-cpp.todo +++ b/ci/Jenkinsfile.windows-cpp.todo @@ -78,6 +78,6 @@ pipeline { post { success { script { github.notifyPR(true) } } failure { script { github.notifyPR(false) } } - cleanup { cleanWs() } + cleanup { sh 'make clean-git' } } }