From 2229677fbaf1f33571d6e220a869c440fb8a2959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Fuente=20P=C3=A9rez?= Date: Thu, 7 Dec 2017 00:43:35 +0100 Subject: [PATCH] Update Jenkinsfile --- openvidu-test-e2e/jenkins/Jenkinsfile | 56 ++++++++++++++------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/openvidu-test-e2e/jenkins/Jenkinsfile b/openvidu-test-e2e/jenkins/Jenkinsfile index 982ef96b..8811913b 100644 --- a/openvidu-test-e2e/jenkins/Jenkinsfile +++ b/openvidu-test-e2e/jenkins/Jenkinsfile @@ -1,30 +1,34 @@ node('container') { - def mycontainer = docker.image('openvidu/openvidu-test-e2e:latest') - mycontainer.pull() - mycontainer.inside("-u root -v /var/run/docker.sock:/var/run/docker.sock:rw -v /dev/shm:/dev/shm") { - stage('Preparation') { - sh 'rm -rf ~/openvidu || true' - sh '/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &' - sh 'git clone https://github.com/OpenVidu/openvidu.git ~/openvidu' - } - stage('OpenVidu parent build') { - sh 'cd ~/openvidu && mvn -DskipTests=true compile && mvn -DskipTests=true install' - } - stage('OpenVidu Browser build') { - sh 'cd ~/openvidu/openvidu-browser && npm install --unsafe-perm && npm link --unsafe-perm' - } - stage('OpenVidu TestApp build') { - sh 'cd ~/openvidu/openvidu-testapp && npm install && npm link openvidu-browser && ng build' - } - stage ("Environment Launch") { - sh 'http-server -p 4200 ~/openvidu/openvidu-testapp/dist &> ~/openvidu/openvidu-testapp/testapp.log &' - sh 'service kurento-media-server-6.0 start' - sh 'cd ~/openvidu/openvidu-server && mvn -DskipTests=true clean compile package exec:java &> ~/openvidu/openvidu-server/openvidu-server.log &' - sh 'until $(curl --insecure --output /dev/null --silent --head --fail https://OPENVIDUAPP:MY_SECRET@localhost:8443/); do echo "Waiting for openvidu-server..."; sleep 5; done' - } - stage ("E2E tests") { - sh "cd ~/openvidu/openvidu-test-e2e && mvn test" - //step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml']) + docker.image('selenium/standalone-chrome-debug:latest').withRun('-p 4444:4444 -p 5900:5900 --shm-size=1g') { c -> + docker.image('elastest/eus-browser-firefox:3.7.1').withRun('-p 4445:4444 -p 5901:5900 --shm-size=1g') { c -> + def mycontainer = docker.image('openvidu/openvidu-test-e2e:latest') + mycontainer.pull() + mycontainer.inside("-p 4200:4200 -p 8443:8443 -u root -v /var/run/docker.sock:/var/run/docker.sock:rw -v /dev/shm:/dev/shm") { + stage('Preparation') { + sh 'rm -rf ~/openvidu || true' + sh 'git clone https://github.com/OpenVidu/openvidu.git ~/openvidu' + } + stage('OpenVidu parent build') { + sh 'cd ~/openvidu && mvn -DskipTests=true install' + } + stage('OpenVidu Browser build') { + sh 'cd ~/openvidu/openvidu-browser && npm install && npm run updatetsc && npm link' + } + stage('OpenVidu TestApp build') { + sh 'cd ~/openvidu/openvidu-testapp && npm install && npm link openvidu-browser && ng build' + } + stage ('Environment Launch') { + sh 'openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -subj '/CN=www.mydom.com/O=My Company LTD./C=US' -keyout ~/openvidu/openvidu-testapp/dist/key.pem -out ~/openvidu/openvidu-testapp/dist/cert.pem' + sh 'cd ~/openvidu/openvidu-testapp/dist && http-server -S -p 4200 &> ~/openvidu/openvidu-testapp/testapp.log &' + sh 'service kurento-media-server-6.0 start' + sh 'cd ~/openvidu/openvidu-server && mvn -DskipTests=true clean -DskipTests=true compile -DskipTests=true package -DskipTests=true -Dopenvidu.publicurl=https://172.17.0.1:8443/ exec:java &> ~/openvidu/openvidu-server/openvidu-server.log &' + sh 'until $(curl --insecure --output /dev/null --silent --head --fail https://OPENVIDUAPP:MY_SECRET@localhost:8443/); do echo "Waiting for openvidu-server..."; sleep 5; done' + } + stage ('E2E tests') { + sh 'cd ~/openvidu/openvidu-test-e2e && mvn -DAPP_URL=https://172.17.0.1:4200/ -DOPENVIDU_URL=https://172.17.0.1:8443/ -DREMOTE_URL_CHROME=http://172.17.0.1:4444/wd/hub/ -DREMOTE_URL_FIREFOX=http://172.17.0.1:4445/wd/hub/ test' + //step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml']) + } + } } } }