eirslett / frontend-maven-plugin: Yarn, как изменить каталог кэша из Jenkinsfile? - PullRequest
0 голосов
/ 07 сентября 2018

У меня несколько сбоев сборки с моим приложением при запуске конвейера Jenkins. Это фрагмент моего Jenkinsfile:

    gitlabCommitStatus(name: 'build') {
        docker.image('openjdk:8').inside('-e MAVEN_OPTS="-Duser.home=./"') {
            stage('check java') {
                sh "java -version"
            }

            stage('clean') {
                sh "chmod +x mvnw"
                sh "./mvnw clean"
            }

            stage('install tools') {
                sh "./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-yarn -DnodeVersion=v8.9.4 -DyarnVersion=v1.3.2"
            }

            stage('yarn install') {
                sh "./mvnw com.github.eirslett:frontend-maven-plugin:yarn"
            }

            stage('packaging') {
                sh "./mvnw verify -Pprod -DskipTests"
                archiveArtifacts artifacts: '**/target/*.war', fingerprint: true
            }

        }
    }

Сборка завершается неудачно при запуске этапа yarn install со следующим журналом:

[WP2@2] Running shell script
+ ./mvnw com.github.eirslett:frontend-maven-plugin:yarn
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building Project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- frontend-maven-plugin:1.6:yarn (default-cli) @ project ---
[INFO] Running 'yarn ' in /dati/jenkins/workspace/WP2@2
[INFO] yarn install v1.3.2
[ERROR] warning Skipping preferred cache folder "/.cache/yarn" because it is not writable.
[ERROR] warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-989".
[INFO] [1/5] Validating package.json...
[INFO] [2/5] Resolving packages...
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@0.5.x"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.3"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@0.1.x"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.3"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@~0.4.1"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.7"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@~0.5.1"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.4.2"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.3"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@0.5.x"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@~0.5.0"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.3"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.1"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@~0.2.0"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.4.4"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.1.41"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.3"
[ERROR] warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.4.2"
[INFO] [3/5] Fetching packages...
[INFO] info If you think this is a bug, please open a bug report with the information provided in "/dati/jenkins/workspace/WP2@2/yarn-error.log".
[INFO] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[ERROR] error An unexpected error occurred: "ENOSPC: no space left on device, write".
[INFO] info There appears to be trouble with your network connection. Retrying...
[INFO] info There appears to be trouble with your network connection. Retrying...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:39 min
[INFO] Finished at: 2018-09-07T15:26:48Z
[INFO] Final Memory: 11M/212M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:yarn (default-cli) on project project: Failed to run task: 'yarn ' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Yarn жалуется на то, что в каталоге кэша недостаточно места. Итак, как я могу изменить каталог кэша Yarn в Jenkins? Я нашел, как это сделать с локальной установкой Yarn, Как мне задать собственный путь кеша для Yarn? , но как сделать то же самое с этим плагином?

...