Skip to content
Permalink
Browse files
jenkins: fix npm build, removing docker -u
npm writes to ~/.npm, and reads ~/.npmrc. But user 910 does
not exist in container, so has no home directory. Therefore
npm fails. Reverting `-u` for now.
  • Loading branch information
aledsage committed Oct 1, 2018
1 parent bd0f52c commit 18d07ee82b10c5fc9415accd200701e1e4ca8642
Showing 1 changed file with 2 additions and 2 deletions.
@@ -38,15 +38,15 @@ node(label: 'ubuntu') {
}

stage('Run tests') {
environmentDockerImage.inside('-i --rm --name brooklyn-${DOCKER_TAG} -u 910:910 --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v ${WORKSPACE}:/usr/build -w /usr/build') {
environmentDockerImage.inside('-i --rm --name brooklyn-${DOCKER_TAG} --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v ${WORKSPACE}:/usr/build -w /usr/build') {
sh 'mvn clean install -Duser.home=/var/maven -Duser.name=jenkins'
}
}

// Conditional stage to deploy artifacts, when not building a PR
if (env.CHANGE_ID == null) {
stage('Deploy artifacts') {
environmentDockerImage.inside('-i --rm --name brooklyn-${DOCKER_TAG} -u 910:910 --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v ${WORKSPACE}:/usr/build -w /usr/build') {
environmentDockerImage.inside('-i --rm --name brooklyn-${DOCKER_TAG} --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v ${WORKSPACE}:/usr/build -w /usr/build') {
sh 'mvn deploy -DskipTests -Duser.home=/var/maven -Duser.name=jenkins'
}
}

0 comments on commit 18d07ee

Please sign in to comment.