Explorar el Código

test new scripts on ci

Henry Oswald hace 8 años
padre
commit
43b1fe4b68

+ 21 - 2
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'

+ 0 - 10
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

+ 1 - 1
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

+ 2 - 2
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",