Henry Oswald 8 лет назад
Родитель
Сommit
b1c0abbd4d

+ 33 - 3
services/clsi/Jenkinsfile

@@ -9,9 +9,34 @@ pipeline {
   }
 
   stages {
-    stage('Build') {
+    stage('Install') {
+      agent {
+        docker {
+          image 'node:6.13.0'
+          args "-v /var/lib/jenkins/.npm:/tmp/.npm -e HOME=/tmp"
+          reuseNode true
+        }
+      }
+      steps {
+        // we need to disable logallrefupdates, else git clones 
+        // during the npm install will require git to lookup the 
+        // user id which does not exist in the container's 
+        // /etc/passwd file, causing the clone to fail.
+        sh 'git config --global core.logallrefupdates false'
+        sh 'rm -rf node_modules'
+        sh 'npm install && npm rebuild'
+      }
+    }
+
+    stage('Compile') {
+      agent {
+        docker {
+          image 'node:6.13.0'
+          reuseNode true
+        }
+      }
       steps {
-        sh 'make build'
+        sh 'npm run compile:all'
       }
     }
 
@@ -29,7 +54,12 @@ pipeline {
 
     stage('Package and publish build') {
       steps {
-        sh 'make publish'
+        sh 'echo ${BUILD_NUMBER} > build_number.txt'
+        sh 'touch build.tar.gz' // Avoid tar warning about files changing during read
+        sh 'tar -czf build.tar.gz --exclude=build.tar.gz --exclude-vcs .'
+        withAWS(credentials:'S3_CI_BUILDS_AWS_KEYS', region:"${S3_REGION_BUILD_ARTEFACTS}") {
+            s3Upload(file:'build.tar.gz', bucket:"${S3_BUCKET_BUILD_ARTEFACTS}", path:"${JOB_NAME}/${BUILD_NUMBER}.tar.gz")
+        }
       }
     }
 

+ 1 - 6
services/clsi/Makefile

@@ -1,7 +1,7 @@
 # This file was auto-generated, do not edit it directly.
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
-# Version: 1.0.3
+# Version: 1.1.0
 
 BUILD_NUMBER ?= local
 BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
@@ -28,10 +28,5 @@ test_acceptance: test_clean # clear the database before each acceptance test run
 
 test_clean:
 	$(DOCKER_COMPOSE) down -t 0
-build:
-	docker build --pull --tag quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) .
-
-publish:
-	docker push quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
 
 .PHONY: clean test test_unit test_acceptance test_clean build publish

+ 0 - 0
services/clsi/docker-compose-overrides.yml → services/clsi/docker-compose-config.yml


+ 9 - 3
services/clsi/docker-compose.ci.yml

@@ -1,17 +1,23 @@
 # This file was auto-generated, do not edit it directly.
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
-# Version: 1.0.3
+# Version: 1.1.0
 
 version: "2"
 
 services:
   test_unit:
-    image: quay.io/sharelatex/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
+    image: node:6.13.0
+    volumes:
+      - .:/app
+    working_dir: /app
     entrypoint: npm run test:unit:_run
 
   test_acceptance:
-    image: quay.io/sharelatex/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
+    image: node:6.13.0
+    volumes:
+      - .:/app
+    working_dir: /app
     environment:
       REDIS_HOST: redis
       MONGO_HOST: mongo

+ 3 - 3
services/clsi/docker-compose.yml

@@ -1,7 +1,7 @@
 # This file was auto-generated, do not edit it directly.
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
-# Version: 1.0.3
+# Version: 1.1.0
 
 version: "2"
 
@@ -14,12 +14,12 @@ services:
     entrypoint: npm run test:unit
 
   test_acceptance:
-    build: .
+    image: node:6.13.0
     volumes:
       - .:/app
     working_dir: /app
     extends:
-      file: docker-compose-overrides.yml
+      file: docker-compose-config.yml
       service: dev
     environment:
       REDIS_HOST: redis

+ 4 - 4
services/clsi/kube.yaml

@@ -6,9 +6,9 @@ metadata:
 spec:
   type: LoadBalancer
   ports:
-  - port: 3009
+  - port: 80
     protocol: TCP
-    targetPort: 3009
+    targetPort: 80
   selector:
     run: clsi
 ---
@@ -26,12 +26,12 @@ spec:
     spec:
       containers:
       - name: clsi
-        image: gcr.io/henry-terraform-admin/clsi:6e0c79688030117a9c27d0fc01d1271e6ac3dd3e
+        image: gcr.io/henry-terraform-admin/clsi
         imagePullPolicy: Always
         readinessProbe:
           httpGet:
             path: status
-            port: 3009
+            port: 80
           periodSeconds: 5
           initialDelaySeconds: 0
           failureThreshold: 3