Jenkinsfile updated to not overwrite branch changes

pull/546/head
pabloFuente 2020-09-11 12:35:42 +02:00
parent 343e4ec200
commit a2daa6baa0
1 changed files with 7 additions and 9 deletions

View File

@ -15,7 +15,7 @@ node('container') {
sh 'rm -rf openvidu || true' sh 'rm -rf openvidu || true'
sh 'rm -rf kurento-java || true' sh 'rm -rf kurento-java || true'
sh 'git clone https://github.com/OpenVidu/openvidu.git' sh 'git clone https://github.com/OpenVidu/openvidu.git'
sh 'cd openvidu && git fetch origin && git checkout $OPENVIDU_COMMIT' sh 'cd openvidu && git fetch --all && git checkout $OPENVIDU_COMMIT'
sh(script: '''#!/bin/bash sh(script: '''#!/bin/bash
if $KURENTO_JAVA_SNAPSHOT ; then if $KURENTO_JAVA_SNAPSHOT ; then
git clone https://github.com/Kurento/kurento-java.git git clone https://github.com/Kurento/kurento-java.git
@ -42,28 +42,26 @@ node('container') {
sh(script: '''#!/bin/bash sh(script: '''#!/bin/bash
cd openvidu cd openvidu
if [[ $OPENVIDU_BROWSER_COMMIT != "default" ]]; then if [[ $OPENVIDU_BROWSER_COMMIT != "default" ]]; then
git checkout -f $OPENVIDU_BROWSER_COMMIT git checkout $OPENVIDU_BROWSER_COMMIT
fi fi
cd openvidu-browser cd openvidu-browser
npm install --unsafe-perm && npm run build npm install --unsafe-perm && npm run build && npm pack
npm pack
cp openvidu-browser-*.tgz /opt/openvidu cp openvidu-browser-*.tgz /opt/openvidu
cd .. cd ..
git checkout -f $OPENVIDU_COMMIT git checkout $OPENVIDU_COMMIT
'''.stripIndent()) '''.stripIndent())
} }
stage('OpenVidu Node Client build') { stage('OpenVidu Node Client build') {
sh(script: '''#!/bin/bash sh(script: '''#!/bin/bash
cd openvidu cd openvidu
if [[ $OPENVIDU_NODE_CLIENT_COMMIT != "default" ]]; then if [[ $OPENVIDU_NODE_CLIENT_COMMIT != "default" ]]; then
git checkout -f $OPENVIDU_NODE_CLIENT_COMMIT git checkout $OPENVIDU_NODE_CLIENT_COMMIT
fi fi
cd openvidu-node-client cd openvidu-node-client
npm install --unsafe-perm && npm run build npm install --unsafe-perm && npm run build && npm pack
npm pack
cp openvidu-node-client-*.tgz /opt/openvidu cp openvidu-node-client-*.tgz /opt/openvidu
cd .. cd ..
git checkout -f $OPENVIDU_COMMIT git checkout $OPENVIDU_COMMIT
'''.stripIndent()) '''.stripIndent())
} }
stage('OpenVidu TestApp build') { stage('OpenVidu TestApp build') {