2017-10-18 18:07:37 +02:00
|
|
|
node('container') {
|
2017-12-07 00:43:35 +01:00
|
|
|
docker.image('selenium/standalone-chrome-debug:latest').withRun('-p 4444:4444 -p 5900:5900 --shm-size=1g') { c ->
|
2017-12-07 00:47:25 +01:00
|
|
|
docker.image('elastest/eus-browser-firefox:3.7.1').withRun('-p 4445:4444 -p 5901:5900 --shm-size=1g') { d ->
|
2017-12-07 00:43:35 +01:00
|
|
|
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") {
|
2018-02-22 10:04:23 +01:00
|
|
|
stage('Preparation') {
|
|
|
|
sh 'rm -rf ~/openvidu || true'
|
2018-02-22 17:35:40 +01:00
|
|
|
sh 'git clone https://github.com/OpenVidu/openvidu.git'
|
2017-12-07 00:43:35 +01:00
|
|
|
}
|
2018-02-22 10:04:23 +01:00
|
|
|
stage('OpenVidu parent build') {
|
2018-02-22 17:35:40 +01:00
|
|
|
sh 'mvn -DskipTests=true install'
|
2018-02-22 10:04:23 +01:00
|
|
|
}
|
|
|
|
stage('OpenVidu Browser build') {
|
2018-02-22 17:35:40 +01:00
|
|
|
sh 'cd openvidu-browser && npm install && npm run updatetsc && npm link'
|
2018-02-22 10:04:23 +01:00
|
|
|
}
|
|
|
|
stage('OpenVidu TestApp build') {
|
2018-02-22 17:35:40 +01:00
|
|
|
sh 'cd openvidu-testapp && npm install && npm link openvidu-browser && ng build'
|
2018-02-22 10:04:23 +01:00
|
|
|
}
|
|
|
|
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'
|
2018-02-22 17:35:40 +01:00
|
|
|
sh 'cd openvidu-testapp/dist && http-server -S -p 4200 &> ~/openvidu/openvidu-testapp/testapp.log &'
|
2018-02-22 10:04:23 +01:00
|
|
|
sh 'service kurento-media-server-6.0 start'
|
2018-02-22 17:35:40 +01:00
|
|
|
sh 'cd 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 &'
|
2018-02-22 10:04:23 +01:00
|
|
|
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') {
|
2018-02-22 17:35:40 +01:00
|
|
|
sh 'cd 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'
|
2018-02-22 16:29:37 +01:00
|
|
|
}
|
|
|
|
stage ('Test report') {
|
2018-02-22 17:35:40 +01:00
|
|
|
junit "openvidu-test-e2e/**/target/surefire-reports/TEST-*.xml"
|
2017-12-07 00:43:35 +01:00
|
|
|
}
|
|
|
|
}
|
2017-10-18 18:07:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|