mirror of https://github.com/OpenVidu/openvidu.git
Update Jenkinsfile
parent
835e15466b
commit
8a5ff43c27
|
@ -3,45 +3,37 @@ node('container') {
|
||||||
docker.image('elastest/eus-browser-firefox:3.7.1').withRun('-p 4445:4444 -p 5901:5900 --shm-size=1g') { d ->
|
docker.image('elastest/eus-browser-firefox:3.7.1').withRun('-p 4445:4444 -p 5901:5900 --shm-size=1g') { d ->
|
||||||
def mycontainer = docker.image('openvidu/openvidu-test-e2e:latest')
|
def mycontainer = docker.image('openvidu/openvidu-test-e2e:latest')
|
||||||
mycontainer.pull()
|
mycontainer.pull()
|
||||||
def USER_ID = sh script: 'id -u $USER', returnStdout: true
|
mycontainer.inside("-p 4200:4200 -p 4443:4443 -u root -e MY_UID=0 -v /var/run/docker.sock:/var/run/docker.sock:rw -v /dev/shm:/dev/shm -v /opt/openvidu/recordings:/opt/openvidu/recordings") {
|
||||||
mycontainer.inside("-p 4200:4200 -p 4443:4443 -e MY_UID=" + USER_ID + " -v /var/run/docker.sock:/var/run/docker.sock:rw -v /dev/shm:/dev/shm -v /opt/openvidu/recordings:/opt/openvidu/recordings") {
|
stage('Preparation') {
|
||||||
withEnv([
|
sh 'rm -rf openvidu || true'
|
||||||
'HOME=.'
|
sh 'rm -rf /opt/openvidu/recordings/* || true'
|
||||||
]) {
|
sh 'git clone https://github.com/OpenVidu/openvidu.git'
|
||||||
stage('Preparation') {
|
}
|
||||||
sh 'rm -rf openvidu || true'
|
stage('OpenVidu parent build') {
|
||||||
sh 'rm -rf /opt/openvidu/recordings/* || true'
|
sh 'cd openvidu && mvn -DskipTests=true install'
|
||||||
sh 'rm -rf ~/.npm-global || true'
|
}
|
||||||
sh 'mkdir ~/.npm-global'
|
stage('OpenVidu Browser build') {
|
||||||
sh 'rm -rf ~/.profile || true'
|
sh 'cd openvidu/openvidu-browser && npm install --unsafe-perm && npm run build && npm link'
|
||||||
sh 'git clone https://github.com/OpenVidu/openvidu.git'
|
}
|
||||||
|
stage('OpenVidu Node Client build') {
|
||||||
|
sh 'cd openvidu/openvidu-node-client && npm install --unsafe-perm && npm run build && npm link'
|
||||||
|
}
|
||||||
|
stage('OpenVidu TestApp build') {
|
||||||
|
sh 'cd openvidu/openvidu-testapp && npm install --unsafe-perm && npm link openvidu-browser && npm link openvidu-node-client && 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 &> ../testapp.log &'
|
||||||
|
sh 'service kurento-media-server 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:4443/ -Dopenvidu.recording=true exec:java &> openvidu-server.log &'
|
||||||
|
sh 'until $(curl --insecure --output /dev/null --silent --head --fail https://OPENVIDUAPP:MY_SECRET@localhost:4443/); do echo "Waiting for openvidu-server..."; sleep 5; done'
|
||||||
|
}
|
||||||
|
stage ('E2E tests') {
|
||||||
|
try {
|
||||||
|
sh 'cd openvidu/openvidu-test-e2e && mvn -DAPP_URL=https://172.17.0.1:4200/ -DOPENVIDU_URL=https://172.17.0.1:4443/ -DREMOTE_URL_CHROME=http://172.17.0.1:4444/wd/hub/ -DREMOTE_URL_FIREFOX=http://172.17.0.1:4445/wd/hub/ test'
|
||||||
}
|
}
|
||||||
stage('OpenVidu parent build') {
|
finally {
|
||||||
sh 'echo "cd openvidu && mvn -DskipTests=true install"'
|
junit "openvidu/openvidu-test-e2e/**/target/surefire-reports/TEST-*.xml"
|
||||||
}
|
|
||||||
stage('OpenVidu Browser build') {
|
|
||||||
sh 'cd openvidu/openvidu-browser && npm install --unsafe-perm && npm run build && npm config set prefix "~/.npm-global" && npm link'
|
|
||||||
}
|
|
||||||
stage('OpenVidu Node Client build') {
|
|
||||||
sh 'cd openvidu/openvidu-node-client && npm install --unsafe-perm && npm run build && npm config set prefix "~/.npm-global" && npm link'
|
|
||||||
}
|
|
||||||
stage('OpenVidu TestApp build') {
|
|
||||||
sh 'cd openvidu/openvidu-testapp && npm install --unsafe-perm && npm config set prefix "~/.npm-global" && npm link openvidu-browser && npm config set prefix "~/.npm-global" && npm link openvidu-node-client && npm config set prefix "~/.npm-global" && 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 &> ../testapp.log &'
|
|
||||||
sh 'service kurento-media-server 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:4443/ -Dopenvidu.recording=true exec:java &> openvidu-server.log &'
|
|
||||||
sh 'until $(curl --insecure --output /dev/null --silent --head --fail https://OPENVIDUAPP:MY_SECRET@localhost:4443/); do echo "Waiting for openvidu-server..."; sleep 5; done'
|
|
||||||
}
|
|
||||||
stage ('E2E tests') {
|
|
||||||
try {
|
|
||||||
sh 'cd openvidu/openvidu-test-e2e && mvn -DAPP_URL=https://172.17.0.1:4200/ -DOPENVIDU_URL=https://172.17.0.1:4443/ -DREMOTE_URL_CHROME=http://172.17.0.1:4444/wd/hub/ -DREMOTE_URL_FIREFOX=http://172.17.0.1:4445/wd/hub/ test'
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
junit "openvidu/openvidu-test-e2e/**/target/surefire-reports/TEST-*.xml"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue