Added Jenkinsfile
Change-Id: I08ff1b9e9af53cdb8809f5e64ce370d31dfbb31a
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..6824302
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,42 @@
+def filename = 'manifest-${branch}.xml'
+
+node ('master') {
+ checkout changelog: false, poll: false, scm: [$class: 'RepoScm', currentBranch: true, manifestBranch: params.branch, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true]
+
+ stage 'Generate and Copy Manifest file'
+ sh returnStdout: true, script: 'repo manifest -r -o ' + filename
+ sh returnStdout: true, script: 'cp ' + filename + ' ' + env.JENKINS_HOME + '/tmp'
+}
+
+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]
+
+ dir('orchestration/xos-gui') {
+ try {
+ stage 'Check Code Style'
+ sh 'npm run lint'
+
+ stage 'Run Unit Tests'
+ sh 'npm test'
+
+ stage 'Build GUI docker container'
+ sh 'docker build -t xosproject/xos-gui .'
+ sh 'docker run -p 4000:4000 -d xosproject/xos-gui'
+ sh 'curl 127.0.0.1:4000/spa/'
+
+ currentBuild.result = 'SUCCESS'
+ } catch (err) {
+ currentBuild.result = 'FAILURE'
+ step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'teo@onlab.us', sendToIndividuals: true])
+ } finally {
+ sh 'docker stop xos-gui'
+ sh 'docker rm xos-gui'
+ sh 'docker rmi xosproject/xos-gui'
+ }
+ echo "RESULT: ${currentBuild.result}"
+ }
+
+ }
+}
\ No newline at end of file