diff --git a/manifest-build.yml b/manifest-build.yml index 52c22fdead94744be43c4be1caf08aa9d0b5b35e..6d42157381d1f722e07ffa7f16e2710905da54e5 100644 --- a/manifest-build.yml +++ b/manifest-build.yml @@ -9,6 +9,19 @@ variables: GIT_BASE_URL: "git@${CI_SERVER_HOST}:${CI_PROJECT_ROOT_NAMESPACE}" TESTS_GIT_URL: "${GIT_BASE_URL}/yocto/tests.git" +.docker_check: &docker_check + # Check if the build folder is empty. Sometimes the docker volume for the build is not + # removed afterwards (e.g. in case of a timeout), then a follow-up build might fail. + - |- + if [ "$(ls -A)" ]; then + echo "ERROR: Build folder is not empty. This might be the case because the" \ + "docker volume has not been not removed in a previous job. Please check" \ + "the docker container \"$CI_JOB_IMAGE\" on the GitLab runner" \ + "\"$CI_RUNNER_SHORT_TOKEN\" ($CI_RUNNER_DESCRIPTION) and remove any" \ + "attached volumes from it." + exit 1 + fi + .setup_ssh: &setup_ssh # setup ssh key to access private repos # https://docs.gitlab.com/ee/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor @@ -81,6 +94,7 @@ variables: INSTALLSCRIPTS: "fng-install.sh fngsystem-self-update.sh" BITBAKE_TASK: "build" before_script: + - *docker_check - *setup_ssh - *repo_checkout script: