[CORD-2338] Single command to run E2E tests

Change-Id: Id8db22b2b496ca16d20d2c4d0739d9b9042540db
diff --git a/Jenkinsfile b/Jenkinsfile
index a3bb485..44fabb1 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -10,59 +10,34 @@
 
 timeout (time: 240) {
     node ("${targetVM}") {
-       stage 'Checkout cord repo'
-       checkout changelog: false, poll: false, scm: [$class: 'RepoScm', currentBranch: true, manifestBranch: params.branch, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true]
+      stage 'Checkout cord repo'
+      checkout changelog: false, poll: false, scm: [$class: 'RepoScm', currentBranch: true, manifestBranch: params.branch, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true]
 
-       dir('orchestration/xos-gui') {
-            try {
+      dir('build') {
+        stage 'Build Mock R-CORD Config'
+        sh 'make PODCONFIG=rcord-local.yml config'
+        sh 'make build'
+      }
+      dir('orchestration/xos-gui') {
+        try {
 
-                stage 'Install Node Modules'
-                sh 'npm install'
+            stage 'Install npm packages'
+            sh 'npm install'
 
-                stage 'Check Code Style'
-                sh 'npm run lint'
-
-                stage 'Run Unit Tests'
-                sh 'npm test'
-
-                // stage 'Build GUI docker container'
-                // sh 'docker pull nginx'
-                // sh 'docker tag nginx nginx:candidate'
-                // sh 'docker build --no-cache -t xosproject/xos-gui .'
-                // sh 'docker run -p 4000:4000 --net=host --name xos-gui -d xosproject/xos-gui'
-            } catch (err) {
-                currentBuild.result = 'FAILURE'
-                step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'teo@onlab.us', sendToIndividuals: true])
-            }
-       }
-       dir('build/platform-install') {
-            stage 'Build Mock R-CORD Config'
-            sh 'ansible-playbook -i inventory/mock-rcord deploy-xos-playbook.yml'
-       }
-       dir('orchestration/xos-gui') {
-            try {
-                stage 'Run E2E Tests'
-                sh 'UI_URL=127.0.0.1:4000/xos/# protractor conf/protractor.conf.js'
-                currentBuild.result = 'SUCCESS'
-            } catch (err) {
-                currentBuild.result = 'FAILURE'
-                step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'teo@onlab.us', sendToIndividuals: true])
-            } finally {
-               stage 'Cleanup'
-               dir('build/platform-install') {
-                    sh 'ansible-playbook -i inventory/mock-rcord teardown-playbook.yml'
-                    sh """
-                    docker rmi -f xosproject/xos-synchronizer-base:candidate || true
-                    docker rmi -f xosproject/xos-client:candidate || true
-                    docker rmi -f xosproject/xos-corebuilder:candidate || true
-                    docker rmi -f xosproject/xos-ui:candidate || true
-                    docker rmi -f xosproject/xos:candidate || true
-                    docker rmi -f xosproject/gui-extension-sample:candidate || true
-                    docker rmi -f xosproject/chameleon:candidate || true
-                    """
-                    echo "RESULT: ${currentBuild.result}"
-               }
-            }
-       }
+            stage 'Run E2E Tests'
+            sh 'UI_URL=127.0.0.1/xos/# npm run test:e2e'
+            currentBuild.result = 'SUCCESS'
+        } catch (err) {
+            currentBuild.result = 'FAILURE'
+            step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'teo@onlab.us', sendToIndividuals: true])
+        } finally {
+           stage 'Cleanup'
+           dir('build') {
+                sh 'make clean-local'
+                sh 'make clean-genconfig'
+                echo "RESULT: ${currentBuild.result}"
+           }
+        }
+      }
     }
 }
\ No newline at end of file