Hi all,
using the default template of sonarcloud in my CI/CD:
test:sonarcloud-check:
stage: test
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- sonar-scanner
allow_failure: true
only:
- merge_requests
- master
- develop
I receive the following error:
[…]
Preparing environment
00:04
[171](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L171)Running on runner-fa6cab46-project-19395361-concurrent-0 via runner-fa6cab46-srm-1597699190-4673133f...
[173](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L173)Getting source from Git repository
00:06
[174](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L174)$ eval "$CI_PRE_CLONE_SCRIPT"
[175](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L175)Fetching changes...
[176](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L176)Initialized empty Git repository in /builds/<redacted>/<redacted>-poc/.git/
[177](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L177)Created fresh repository.
[178](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L178)Checking out 888c6f2c as refs/merge-requests/52/head...
[179](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L179)Skipping Git submodules setup
[181](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L181)Restoring cache
00:01
[182](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L182)Checking cache for test:sonarcloud-check...
[183](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L183)FATAL: file does not exist
[184](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L184)Failed to extract cache
[186](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L186)Downloading artifacts
00:14
[187](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L187)Downloading artifacts for build (690394198)...
[188](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L188)Downloading artifacts from coordinator... ok id=690394198 responseStatus=200 OK token=zAdd2w27
[190](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L190)Executing "step_script" stage of the job script
00:01
[191](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L191)$ rm -r /srv/app
[192](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L192)rm: can't remove '/srv/app': No such file or directory
[194](https://gitlab.com/<redacted>/<redacted>-poc/-/jobs/690394200#L194)ERROR: Job failed: exit code 1
I like to deploy laravel + vue application.
Any idea how to fix that? Thank you very much!
Locally running the project with docker works fine
docker run --rm -e SONAR_HOST_URL="https://sonarcloud.io" -v "$(pwd):/usr/src" sonarsource/sonar-scanner-cli