Updated Jenkinsfile to support openvidu-browser, openvidu-node-client commit selection

pull/546/head
pabloFuente 2020-09-09 12:40:26 +02:00
parent 8f1512f965
commit 557a2e764a
1 changed files with 31 additions and 9 deletions

View File

@ -18,13 +18,13 @@ node('container') {
sh 'cd openvidu && git fetch origin && git checkout $OPENVIDU_COMMIT'
sh(script: '''#!/bin/bash
if $KURENTO_JAVA_SNAPSHOT ; then
git clone https://github.com/Kurento/kurento-java.git
cd kurento-java && MVN_VERSION=$(mvn --batch-mode -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
cd ../openvidu && mvn --batch-mode versions:set-property -Dproperty=version.kurento -DnewVersion=$MVN_VERSION
mvn dependency:get -DrepoUrl=https://maven.openvidu.io/repository/snapshots/ -Dartifact=org.kurento:kurento-client:$MVN_VERSION
mvn dependency:get -DrepoUrl=https://maven.openvidu.io/repository/snapshots/ -Dartifact=org.kurento:kurento-jsonrpc-client-jetty:$MVN_VERSION
mvn dependency:get -DrepoUrl=https://maven.openvidu.io/repository/snapshots/ -Dartifact=org.kurento:kurento-jsonrpc-server:$MVN_VERSION
mvn dependency:get -DrepoUrl=https://maven.openvidu.io/repository/snapshots/ -Dartifact=org.kurento:kurento-test:$MVN_VERSION
git clone https://github.com/Kurento/kurento-java.git
cd kurento-java && MVN_VERSION=$(mvn --batch-mode -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
cd ../openvidu && mvn --batch-mode versions:set-property -Dproperty=version.kurento -DnewVersion=$MVN_VERSION
mvn dependency:get -DrepoUrl=https://maven.openvidu.io/repository/snapshots/ -Dartifact=org.kurento:kurento-client:$MVN_VERSION
mvn dependency:get -DrepoUrl=https://maven.openvidu.io/repository/snapshots/ -Dartifact=org.kurento:kurento-jsonrpc-client-jetty:$MVN_VERSION
mvn dependency:get -DrepoUrl=https://maven.openvidu.io/repository/snapshots/ -Dartifact=org.kurento:kurento-jsonrpc-server:$MVN_VERSION
mvn dependency:get -DrepoUrl=https://maven.openvidu.io/repository/snapshots/ -Dartifact=org.kurento:kurento-test:$MVN_VERSION
fi
'''.stripIndent())
sh(script: '''#!/bin/bash
@ -44,10 +44,32 @@ node('container') {
sh 'cd openvidu && mvn --batch-mode -DskipTests=true clean install'
}
stage('OpenVidu Browser build') {
sh 'cd openvidu/openvidu-browser && npm install --unsafe-perm && npm run build && npm link'
sh(script: '''#!/bin/bash
if [[ $OPENVIDU_BROWSER_COMMIT != "default" ]]; then
cd openvidu
git checkout $OPENVIDU_BROWSER_COMMIT
cd openvidu-browser
npm install --unsafe-perm && npm run build && npm link
cd ..
git checkout $OPENVIDU_COMMIT
else
cd openvidu/openvidu-browser && npm install --unsafe-perm && npm run build && npm link
fi
'''.stripIndent())
}
stage('OpenVidu Node Client build') {
sh 'cd openvidu/openvidu-node-client && npm install --unsafe-perm && npm run build && npm link'
sh(script: '''#!/bin/bash
if [[ $OPENVIDU_NODE_CLIENT_COMMIT != "default" ]]; then
cd openvidu
git checkout $OPENVIDU_NODE_CLIENT_COMMIT
cd openvidu-node-client
npm install --unsafe-perm && npm run build && npm link
cd ..
git checkout $OPENVIDU_COMMIT
else
cd openvidu/openvidu-node-client && npm install --unsafe-perm && npm run build && npm link
fi
'''.stripIndent())
}
stage('OpenVidu TestApp build') {
sh 'cd openvidu/openvidu-testapp && npm install --unsafe-perm && npm link openvidu-browser && npm link openvidu-node-client && export NG_CLI_ANALYTICS=ci && ./node_modules/@angular/cli/bin/ng build --prod'