diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f7213b4699d0e05f794ec16c9519c167ad6e9277..207f13ad266fb3e491aab31340be090ac1c9e8d1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,7 @@ win_visual_studio_static_local_deps:
     stage: build
 
     before_script:
+        - rmdir /s /q build external_dependencies/*
         - call VsDevCmd.bat
         - set DEPENDENCIES_LINK_TYPE=static
         - set clean_after=yes
@@ -35,6 +36,7 @@ win_visual_studio_2015_static_local_deps:
     stage: build
 
     before_script:
+        - rmdir /s /q build external_dependencies/*
         - set DEPENDENCIES_LINK_TYPE=static
         - set clean_after=yes
         - set BUILD_LIB=yes
@@ -53,6 +55,7 @@ ubuntu_boost_system:
     stage: build
 
     before_script:
+        - rm -rf build external_dependencies/*
         - export TERM=xterm
         - export DEPENDENCIES_LINK_TYPE=shared
         - export CLEAN_AFTER=yes
@@ -71,6 +74,7 @@ ubuntu_boost_local_static_deps:
     stage: build
 
     before_script:
+        - rm -rf build external_dependencies/*
         - export TERM=xterm
         - export DEPENDENCIES_LINK_TYPE=static
         - export CLEAN_AFTER=yes
@@ -89,6 +93,7 @@ centos_local_deps:
     stage: build
 
     before_script:
+        - rm -rf build external_dependencies/*
         - export TERM=xterm
         - export DEPENDENCIES_LINK_TYPE=static
         - export CLEAN_AFTER=yes