From 4ff6cd3006f7d05a2c73fc9e6099051370ac0f04 Mon Sep 17 00:00:00 2001 From: Joe Green Date: Thu, 28 Sep 2017 11:50:33 +0100 Subject: [PATCH] Jg jenkinsfile cleanup (#75) * Update Jenkinsfile make sure we don't ship unneeded build files * Update ExampleDocumentTests.coffee * use node 6.11.2 in jenkins file --- services/clsi/Jenkinsfile | 19 +++++++++++-------- .../coffee/ExampleDocumentTests.coffee | 3 +++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/services/clsi/Jenkinsfile b/services/clsi/Jenkinsfile index 9360d1f336..e713fa7344 100644 --- a/services/clsi/Jenkinsfile +++ b/services/clsi/Jenkinsfile @@ -12,13 +12,14 @@ pipeline { steps { // This is a terrible hack to set the file ownership to jenkins:jenkins so we can cleanup the directory sh 'docker run -v $(pwd):/app --rm busybox /bin/chown -R 111:119 /app' + sh 'rm -fr node_modules' } } stage('Install') { agent { docker { - image 'node:4.2.1' - args "-v /var/lib/jenkins/.npm:/tmp/.npm -e HOME=/tmp" + image 'node:6.11.2' + args "-e HOME=/tmp" reuseNode true } } @@ -27,16 +28,15 @@ pipeline { sh 'rm -fr node_modules' checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: '_docker-runner'], [$class: 'CloneOption', shallow: true]], userRemoteConfigs: [[credentialsId: 'GIT_DEPLOY_KEY', url: 'git@github.com:sharelatex/docker-runner-sharelatex']]]) sh 'npm install ./_docker-runner' - sh 'rm -fr ./_docker-runner' + sh 'rm -fr ./_docker-runner ./_docker-runner@tmp' sh 'npm install' - sh 'npm rebuild' sh 'npm install --quiet grunt-cli' } } stage('Compile and Test') { agent { docker { - image 'node:4.2.1' + image 'node:6.11.2' reuseNode true } } @@ -51,12 +51,15 @@ pipeline { TEXLIVE_IMAGE="quay.io/sharelatex/texlive-full:2017.1" } steps { - sh 'mkdir -p compiles' + sh 'mkdir -p compiles cache' // Not yet running, due to volumes/sibling containers sh 'docker container prune -f' sh 'docker pull $TEXLIVE_IMAGE' - sh 'docker pull sharelatex/acceptance-test-runner:clsi-4.2.1' - sh 'docker run --rm -e SIBLING_CONTAINER_USER=root -e SANDBOXED_COMPILES_HOST_DIR=$(pwd)/compiles -e SANDBOXED_COMPILES_SIBLING_CONTAINERS=true -e TEXLIVE_IMAGE=$TEXLIVE_IMAGE -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/app sharelatex/acceptance-test-runner:clsi-4.2.1' + sh 'docker pull sharelatex/acceptance-test-runner:clsi-6.11.2' + sh 'docker run --rm -e SIBLING_CONTAINER_USER=root -e SANDBOXED_COMPILES_HOST_DIR=$(pwd)/compiles -e SANDBOXED_COMPILES_SIBLING_CONTAINERS=true -e TEXLIVE_IMAGE=$TEXLIVE_IMAGE -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/app sharelatex/acceptance-test-runner:clsi-6.11.2' + // This is a terrible hack to set the file ownership to jenkins:jenkins so we can cleanup the directory + sh 'docker run -v $(pwd):/app --rm busybox /bin/chown -R 111:119 /app' + sh 'rm -r compiles cache server.log db.sqlite config/settings.defaults.coffee' } } stage('Package') { diff --git a/services/clsi/test/acceptance/coffee/ExampleDocumentTests.coffee b/services/clsi/test/acceptance/coffee/ExampleDocumentTests.coffee index 4e36c6ac05..4d431c29c2 100644 --- a/services/clsi/test/acceptance/coffee/ExampleDocumentTests.coffee +++ b/services/clsi/test/acceptance/coffee/ExampleDocumentTests.coffee @@ -12,6 +12,9 @@ catch e convertToPng = (pdfPath, pngPath, callback = (error) ->) -> convert = ChildProcess.exec "convert #{fixturePath(pdfPath)} #{fixturePath(pngPath)}" + stdout = "" + convert.stdout.on "data", (chunk) -> console.log "STDOUT", chunk.toString() + convert.stderr.on "data", (chunk) -> console.log "STDERR", chunk.toString() convert.on "exit", () -> callback()