Jenkinsfile: use maven settings so snapshots can be downloaded. Build kurento mvn build snapshots with only one thread to avoid github packages download restrictions

pull/732/head
cruizba 2022-06-01 10:47:04 +02:00
parent 4af8be5a72
commit bbb16189ef
1 changed files with 152 additions and 147 deletions

View File

@ -1,4 +1,7 @@
node('container') {
withEnv(["MVN_SETTINGS_VOLUME=/opt/openvidu-settings.xml",
'MVN_OPTIONS=--settings /opt/openvidu-settings.xml -B']){
// Load and execute common functions Groovy script
sh 'curl -O https://raw.githubusercontent.com/OpenVidu/openvidu/master/openvidu-test-e2e/jenkins/commonFunctions.groovy'
def commonFunctions = load 'commonFunctions.groovy'
@ -13,7 +16,8 @@ node('container') {
'-v /dev/shm:/dev/shm',
'-v /opt/openvidu:/opt/openvidu',
'-v /opt/openvidu-cache/test-layouts:/opt/openvidu/test-layouts',
'-v /opt/openvidu-cache/.m2:/root/.m2'].join(' ')
'-v /opt/openvidu-cache/.m2:/root/.m2',
"-v ${MAVEN_SETTINGS}:${MVN_SETTINGS_VOLUME}"].join(' ')
// Run openvidu/openvidu-test-e2e container
docker.image("openvidu/openvidu-test-e2e:${DISTRO}").inside('--privileged -p 4200:4200 -p 4443:4443 -p 4114:4114 -u root -e MY_UID=0 ' + "${bindsArray}") {
@ -77,29 +81,29 @@ node('container') {
git clone https://github.com/Kurento/kurento-java.git
cd kurento-java
git checkout -f ${KURENTO_JAVA_COMMIT}
mvn -B clean install
MVN_VERSION=$(mvn -B -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
cd ../openvidu && mvn -B versions:set-property -Dproperty=version.kurento -DnewVersion=${MVN_VERSION}
MVN_VERSION="$(grep -oPm1 "(?<=<version>)[^<]+" "pom.xml")"
mvn ${MVN_OPTIONS} -Dmaven.artifact.threads=1 clean install
cd ../openvidu && mvn ${MVN_OPTIONS} versions:set-property -Dproperty=version.kurento -DnewVersion=${MVN_VERSION}
fi
'''.stripIndent())
sh 'cd openvidu && mvn -B versions:set-property -Dproperty=version.openvidu.java.client -DnewVersion=TEST'
sh 'cd openvidu && mvn -B -DskipTests=true clean install'
sh 'cd openvidu && mvn ${MVN_OPTIONS} versions:set-property -Dproperty=version.openvidu.java.client -DnewVersion=TEST'
sh 'cd openvidu && mvn ${MVN_OPTIONS} -DskipTests=true clean install'
}
stage('OpenVidu Server unit tests') {
sh 'cd openvidu/openvidu-server && mvn -B -Dtest=io.openvidu.server.test.unit.*Test test'
sh 'cd openvidu/openvidu-server && mvn ${MVN_OPTIONS} -Dtest=io.openvidu.server.test.unit.*Test test'
}
stage('OpenVidu Server integration tests') {
sh 'cd openvidu/openvidu-server && mvn -B -Dtest=io.openvidu.server.test.integration.*Test test'
sh 'cd openvidu/openvidu-server && mvn ${MVN_OPTIONS} -Dtest=io.openvidu.server.test.integration.*Test test'
}
stage('OpenVidu Test E2E build') {
sh(script: '''#!/bin/bash -xe
cd openvidu/openvidu-test-browsers
mvn -B versions:set -DnewVersion=TEST && mvn -B clean install
mvn ${MVN_OPTIONS} versions:set -DnewVersion=TEST && mvn ${MVN_OPTIONS} clean install
cd ..
mvn -B versions:set-property -Dproperty=version.openvidu.java.client -DnewVersion=TEST
mvn -B versions:set-property -Dproperty=version.openvidu.test.browsers -DnewVersion=TEST
mvn ${MVN_OPTIONS} versions:set-property -Dproperty=version.openvidu.java.client -DnewVersion=TEST
mvn ${MVN_OPTIONS} versions:set-property -Dproperty=version.openvidu.test.browsers -DnewVersion=TEST
cd openvidu-test-e2e
mvn -B -DskipTests=true clean install
mvn ${MVN_OPTIONS} -DskipTests=true clean install
'''.stripIndent())
}
}
@ -108,7 +112,7 @@ node('container') {
stage('OpenVidu Server build') {
sh(script: '''#!/bin/bash -xe
cd openvidu/openvidu-server
mvn -B -DskipTests=true package
mvn ${MVN_OPTIONS} -DskipTests=true package
cp target/openvidu-server*.jar /opt/openvidu
'''.stripIndent())
}
@ -162,6 +166,7 @@ node('container') {
}
}
}
}
def environmentLaunch(mediaServer) {
sh 'openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -subj "/CN=www.mydom.com/O=My Company LTD./C=US" -keyout /opt/openvidu/testapp/key.pem -out /opt/openvidu/testapp/cert.pem'
@ -229,7 +234,7 @@ def openViduE2ETest(mediaServerImage) {
if [[ $mediaServerImage == *"openvidu/mediasoup-controller"* ]]; then
ENV_VARS+=" -DOPENVIDU_PRO_LICENSE=${openviduProLicense} -DOPENVIDU_PRO_LICENSE_API=${openviduProLicenseApi}"
fi
sudo mvn -B ${ENV_VARS} test
sudo mvn ${MVN_OPTIONS} ${ENV_VARS} test
'''.stripIndent())
}
}