formation před 4 roky
rodič
revize
040d4a2714
1 změnil soubory, kde provedl 49 přidání a 0 odebrání
  1. 49 0
      Jenkinsfile

+ 49 - 0
Jenkinsfile

@@ -45,6 +45,55 @@ node{
     stage('stage 2bis'){
         sh 'ls -ls'
     }
+    stage('Test') 
+    {
+        
+       dir("${env.WORKSPACE}/angular-client")
+       {
+            sh 'npm i @angular-devkit/build-angular'
+          		
+			try
+			{
+				sh 'npm run test-ci'
+			} 
+			catch(err) 
+			{
+				sh 'echo TEST FAILED'
+				junit 'target/surefire-reports/TESTS-TestSuite.xml/*.xml'
+				throw err
+			}
+            
+            /*def karma = docker.image('trion/ng-cli-karma')
+            karma.pull()
+
+            try 
+            {
+                karma.run(' -u $(id -u) -v ${WORKSPACE}:/app trion/ng-cli-karma ')
+                karma.inside 
+                {
+                    sh 'npm install'
+                
+                    try 
+                    {
+                        sh ('./node_modules/karma/bin/karma start karma.conf.js')
+                    }
+                    catch(err) 
+                    {
+                        sh 'echo TEST FAILED'
+                        step([$class: 'JUnitResultArchiver', testResults: 'target/surefire-reports/TESTS-TestSuite.xml/*.xml', healthScaleFactor: 1.0])
+                        throw err
+                    }
+                    sh 'echo DO SOMETHING ELSE AFTER TEST'
+                }
+                sh 'ls -al '
+            } 
+            catch(err) 
+            {
+            sh 'echo RUN DOCKER FAILED'
+            throw err
+            }*/
+       }
+    }
     // stage('Build Angular PreProduction')
     // {
     //     //sh 'docker build -f build/docker/apache/Dockerfile -t sample-app:0.1 angular-client/dist'