diff --git a/services/clsi/Jenkinsfile b/services/clsi/Jenkinsfile index 7a34ee75bd..bc9ba0142f 100644 --- a/services/clsi/Jenkinsfile +++ b/services/clsi/Jenkinsfile @@ -9,11 +9,30 @@ pipeline { } stages { - stage('CI') { + stage('Build') { steps { - sh 'make ci' + sh 'make build' } } + + stage('Unit Tests') { + steps { + sh 'DOCKER_COMPOSE_FLAGS="-f docker-compose.ci.yml" make test_unit' + } + } + + stage('Acceptance Tests') { + steps { + sh 'DOCKER_COMPOSE_FLAGS="-f docker-compose.ci.yml" make test_acceptance' + } + } + + stage('Package and publish build') { + steps { + sh 'make publish' + } + } + stage('Publish build number') { steps { sh 'echo ${BRANCH_NAME}-${BUILD_NUMBER} > build_number.txt' diff --git a/services/clsi/Makefile b/services/clsi/Makefile index 063d96e602..74b78a3d42 100644 --- a/services/clsi/Makefile +++ b/services/clsi/Makefile @@ -33,16 +33,6 @@ build: publish: docker push quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) - -ci: - # On the CI server, we want to run our tests in the image that we - # have built for deployment, which is what the docker-compose.ci.yml - # override does. - PROJECT_NAME=$(PROJECT_NAME) \ - BRANCH_NAME=$(BRANCH_NAME) \ - BUILD_NUMBER=$(BUILD_NUMBER) \ - DOCKER_COMPOSE_FLAGS="-f docker-compose.ci.yml" \ - $(MAKE) build test publish .PHONY: clean test test_unit test_acceptance test_clean build publish diff --git a/services/clsi/docker-compose.ci.yml b/services/clsi/docker-compose.ci.yml index 2ca2f9a32b..98715c2644 100644 --- a/services/clsi/docker-compose.ci.yml +++ b/services/clsi/docker-compose.ci.yml @@ -15,7 +15,7 @@ services: image: quay.io/sharelatex/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER extends: file: docker-compose-config.yml - service: dev + service: ci environment: REDIS_HOST: redis MONGO_HOST: mongo diff --git a/services/clsi/package.json b/services/clsi/package.json index fed32605ba..54181da596 100644 --- a/services/clsi/package.json +++ b/services/clsi/package.json @@ -9,9 +9,9 @@ "scripts": { "compile:test:acceptance": "coffee -o test/acceptance/js -c test/acceptance/coffee", "compile:test:smoke": "coffee -o test/smoke/js -c test/smoke/coffee", - "compile:app": "coffee -o app/js -c app/coffee && coffee -c app.coffee", + "compile:app": "coffee $COFFEE_OPTIONS -o app/js -c app/coffee && coffee $COFFEE_OPTIONS -c app.coffee", "compile": "npm run compile:app && npm run compile:test:acceptance && npm run compile:test:smoke", - "start": "npm run compile:app && node app.js", + "start": "npm run compile:app && node $NODE_APP_OPTIONS app.js", "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance": "npm run compile:app && npm run compile:acceptance_tests && npm run test:acceptance:_run -- $@", "test:unit:_run": "mocha --recursive --exit --reporter spec $@ test/unit/js",