Jenkinsfile: name parallel tasks without stages

pull/661/head
pabloFuente 2021-10-22 12:26:13 +02:00
parent cffa50ddab
commit d234639423
1 changed files with 54 additions and 50 deletions

View File

@ -57,56 +57,57 @@ node('container') {
'''.stripIndent()) '''.stripIndent())
} }
stage('Artifacts build 1') { stage('Build 1') {
parallel 'OpenVidu Browser build': { parallel 'OpenVidu Browser build': {
stage('OpenVidu Browser build') { stage('OpenVidu Browser build') {
sh(script: '''#!/bin/bash -xe sh(script: '''#!/bin/bash -xe
cd openvidu cd openvidu
if [[ $OPENVIDU_BROWSER_COMMIT != "default" ]]; then if [[ $OPENVIDU_BROWSER_COMMIT != "default" ]]; then
git checkout -f $OPENVIDU_BROWSER_COMMIT git checkout -f $OPENVIDU_BROWSER_COMMIT
fi fi
cd openvidu-browser cd openvidu-browser
npm install --unsafe-perm && npm run build && npm pack npm install --unsafe-perm && npm run build && npm pack
cp openvidu-browser-*.tgz /opt/openvidu cp openvidu-browser-*.tgz /opt/openvidu
cd .. cd ..
git checkout -f $OPENVIDU_COMMIT git checkout -f $OPENVIDU_COMMIT
'''.stripIndent()) '''.stripIndent())
} }
}, 'OpenVidu Node Client build': { }, 'OpenVidu Node Client build': {
stage('OpenVidu Node Client build') { stage('OpenVidu Node Client build') {
sh(script: '''#!/bin/bash -xe sh(script: '''#!/bin/bash -xe
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 -f $OPENVIDU_NODE_CLIENT_COMMIT
fi fi
cd openvidu-node-client cd openvidu-node-client
npm install --unsafe-perm && npm run build && npm pack npm install --unsafe-perm && npm run build && 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 -f $OPENVIDU_COMMIT
'''.stripIndent()) '''.stripIndent())
} }
}, 'OpenVidu Java Client build': { }, 'OpenVidu Java Client build': {
stage('OpenVidu Java Client build') { stage('OpenVidu Java Client build') {
sh(script: '''#!/bin/bash -xe sh(script: '''#!/bin/bash -xe
cd openvidu cd openvidu
if [[ $OPENVIDU_JAVA_CLIENT_COMMIT != "default" ]]; then if [[ $OPENVIDU_JAVA_CLIENT_COMMIT != "default" ]]; then
git checkout -f $OPENVIDU_JAVA_CLIENT_COMMIT git checkout -f $OPENVIDU_JAVA_CLIENT_COMMIT
fi fi
cd openvidu-java-client cd openvidu-java-client
mvn --batch-mode versions:set -DnewVersion=TEST mvn --batch-mode versions:set -DnewVersion=TEST
mvn clean compile package mvn clean compile package
mvn install:install-file -Dfile=target/openvidu-java-client-TEST.jar -DgroupId=io.openvidu -DartifactId=openvidu-java-client -Dversion=TEST -Dpackaging=jar mvn install:install-file -Dfile=target/openvidu-java-client-TEST.jar -DgroupId=io.openvidu -DartifactId=openvidu-java-client -Dversion=TEST -Dpackaging=jar
cd .. cd ..
git checkout -f $OPENVIDU_COMMIT git checkout -f $OPENVIDU_COMMIT
'''.stripIndent()) '''.stripIndent())
} }
} }
} }
stage('Artifacts build 2') { stage('Build 2') {
parallel 'OpenVidu TestApp build': { parallel 'OpenVidu TestApp build': {
sh(script: '''#!/bin/bash -xe stage('OpenVidu TestApp build') {
sh(script: '''#!/bin/bash -xe
cd openvidu cd openvidu
if [[ $OPENVIDU_TESTAPP_COMMIT != "default" ]]; then if [[ $OPENVIDU_TESTAPP_COMMIT != "default" ]]; then
git checkout -f $OPENVIDU_TESTAPP_COMMIT git checkout -f $OPENVIDU_TESTAPP_COMMIT
@ -119,15 +120,18 @@ node('container') {
cd .. cd ..
git checkout -f $OPENVIDU_COMMIT git checkout -f $OPENVIDU_COMMIT
'''.stripIndent()) '''.stripIndent())
}
}, 'OpenVidu parent build': { }, 'OpenVidu parent build': {
stage('OpenVidu parent build') {
sh(script: '''#!/bin/bash -xe sh(script: '''#!/bin/bash -xe
if [[ $KURENTO_JAVA_COMMIT != "default" ]]; then if [[ $KURENTO_JAVA_COMMIT != "default" ]]; then
cd kurento-java && MVN_VERSION=$(mvn --batch-mode -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) 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 cd ../openvidu && mvn --batch-mode versions:set-property -Dproperty=version.kurento -DnewVersion=$MVN_VERSION
fi fi
'''.stripIndent()) '''.stripIndent())
sh 'cd openvidu && mvn --batch-mode versions:set-property -Dproperty=version.openvidu.java.client -DnewVersion=TEST' sh 'cd openvidu && mvn --batch-mode versions:set-property -Dproperty=version.openvidu.java.client -DnewVersion=TEST'
sh 'cd openvidu && mvn --batch-mode -DskipTests=true clean install' sh 'cd openvidu && mvn --batch-mode -DskipTests=true clean install'
}
} }
} }