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
This commit is contained in:
Joe Green 2017-09-28 11:50:33 +01:00 committed by GitHub
parent 860929b198
commit 4ff6cd3006
2 changed files with 14 additions and 8 deletions

View file

@ -12,13 +12,14 @@ pipeline {
steps { steps {
// This is a terrible hack to set the file ownership to jenkins:jenkins so we can cleanup the directory // 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 'docker run -v $(pwd):/app --rm busybox /bin/chown -R 111:119 /app'
sh 'rm -fr node_modules'
} }
} }
stage('Install') { stage('Install') {
agent { agent {
docker { docker {
image 'node:4.2.1' image 'node:6.11.2'
args "-v /var/lib/jenkins/.npm:/tmp/.npm -e HOME=/tmp" args "-e HOME=/tmp"
reuseNode true reuseNode true
} }
} }
@ -27,16 +28,15 @@ pipeline {
sh 'rm -fr node_modules' 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']]]) 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 'npm install ./_docker-runner'
sh 'rm -fr ./_docker-runner' sh 'rm -fr ./_docker-runner ./_docker-runner@tmp'
sh 'npm install' sh 'npm install'
sh 'npm rebuild'
sh 'npm install --quiet grunt-cli' sh 'npm install --quiet grunt-cli'
} }
} }
stage('Compile and Test') { stage('Compile and Test') {
agent { agent {
docker { docker {
image 'node:4.2.1' image 'node:6.11.2'
reuseNode true reuseNode true
} }
} }
@ -51,12 +51,15 @@ pipeline {
TEXLIVE_IMAGE="quay.io/sharelatex/texlive-full:2017.1" TEXLIVE_IMAGE="quay.io/sharelatex/texlive-full:2017.1"
} }
steps { steps {
sh 'mkdir -p compiles' sh 'mkdir -p compiles cache'
// Not yet running, due to volumes/sibling containers // Not yet running, due to volumes/sibling containers
sh 'docker container prune -f' sh 'docker container prune -f'
sh 'docker pull $TEXLIVE_IMAGE' sh 'docker pull $TEXLIVE_IMAGE'
sh 'docker pull 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-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-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') { stage('Package') {

View file

@ -12,6 +12,9 @@ catch e
convertToPng = (pdfPath, pngPath, callback = (error) ->) -> convertToPng = (pdfPath, pngPath, callback = (error) ->) ->
convert = ChildProcess.exec "convert #{fixturePath(pdfPath)} #{fixturePath(pngPath)}" 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", () -> convert.on "exit", () ->
callback() callback()