From d234639423fa2bc57ed61131820d946525ec7c5b Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Fri, 22 Oct 2021 12:26:13 +0200 Subject: [PATCH] Jenkinsfile: name parallel tasks without stages --- openvidu-test-e2e/jenkins/Jenkinsfile | 104 +++++++++++++------------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/openvidu-test-e2e/jenkins/Jenkinsfile b/openvidu-test-e2e/jenkins/Jenkinsfile index cbc6aed2..06f92c49 100644 --- a/openvidu-test-e2e/jenkins/Jenkinsfile +++ b/openvidu-test-e2e/jenkins/Jenkinsfile @@ -57,56 +57,57 @@ node('container') { '''.stripIndent()) } - stage('Artifacts build 1') { + stage('Build 1') { parallel 'OpenVidu Browser build': { - stage('OpenVidu Browser build') { - sh(script: '''#!/bin/bash -xe - cd openvidu - if [[ $OPENVIDU_BROWSER_COMMIT != "default" ]]; then - git checkout -f $OPENVIDU_BROWSER_COMMIT - fi - cd openvidu-browser - npm install --unsafe-perm && npm run build && npm pack - cp openvidu-browser-*.tgz /opt/openvidu - cd .. - git checkout -f $OPENVIDU_COMMIT - '''.stripIndent()) - } + stage('OpenVidu Browser build') { + sh(script: '''#!/bin/bash -xe + cd openvidu + if [[ $OPENVIDU_BROWSER_COMMIT != "default" ]]; then + git checkout -f $OPENVIDU_BROWSER_COMMIT + fi + cd openvidu-browser + npm install --unsafe-perm && npm run build && npm pack + cp openvidu-browser-*.tgz /opt/openvidu + cd .. + git checkout -f $OPENVIDU_COMMIT + '''.stripIndent()) + } }, 'OpenVidu Node Client build': { - stage('OpenVidu Node Client build') { - sh(script: '''#!/bin/bash -xe - cd openvidu - if [[ $OPENVIDU_NODE_CLIENT_COMMIT != "default" ]]; then - git checkout -f $OPENVIDU_NODE_CLIENT_COMMIT - fi - cd openvidu-node-client - npm install --unsafe-perm && npm run build && npm pack - cp openvidu-node-client-*.tgz /opt/openvidu - cd .. - git checkout -f $OPENVIDU_COMMIT - '''.stripIndent()) - } + stage('OpenVidu Node Client build') { + sh(script: '''#!/bin/bash -xe + cd openvidu + if [[ $OPENVIDU_NODE_CLIENT_COMMIT != "default" ]]; then + git checkout -f $OPENVIDU_NODE_CLIENT_COMMIT + fi + cd openvidu-node-client + npm install --unsafe-perm && npm run build && npm pack + cp openvidu-node-client-*.tgz /opt/openvidu + cd .. + git checkout -f $OPENVIDU_COMMIT + '''.stripIndent()) + } }, 'OpenVidu Java Client build': { - stage('OpenVidu Java Client build') { - sh(script: '''#!/bin/bash -xe - cd openvidu - if [[ $OPENVIDU_JAVA_CLIENT_COMMIT != "default" ]]; then - git checkout -f $OPENVIDU_JAVA_CLIENT_COMMIT - fi - cd openvidu-java-client - mvn --batch-mode versions:set -DnewVersion=TEST - 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 - cd .. - git checkout -f $OPENVIDU_COMMIT - '''.stripIndent()) - } + stage('OpenVidu Java Client build') { + sh(script: '''#!/bin/bash -xe + cd openvidu + if [[ $OPENVIDU_JAVA_CLIENT_COMMIT != "default" ]]; then + git checkout -f $OPENVIDU_JAVA_CLIENT_COMMIT + fi + cd openvidu-java-client + mvn --batch-mode versions:set -DnewVersion=TEST + 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 + cd .. + git checkout -f $OPENVIDU_COMMIT + '''.stripIndent()) + } } } - stage('Artifacts build 2') { + stage('Build 2') { parallel 'OpenVidu TestApp build': { - sh(script: '''#!/bin/bash -xe + stage('OpenVidu TestApp build') { + sh(script: '''#!/bin/bash -xe cd openvidu if [[ $OPENVIDU_TESTAPP_COMMIT != "default" ]]; then git checkout -f $OPENVIDU_TESTAPP_COMMIT @@ -119,15 +120,18 @@ node('container') { cd .. git checkout -f $OPENVIDU_COMMIT '''.stripIndent()) + } }, 'OpenVidu parent build': { + stage('OpenVidu parent build') { sh(script: '''#!/bin/bash -xe - 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 ../openvidu && mvn --batch-mode versions:set-property -Dproperty=version.kurento -DnewVersion=$MVN_VERSION - fi - '''.stripIndent()) - 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' + 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 ../openvidu && mvn --batch-mode versions:set-property -Dproperty=version.kurento -DnewVersion=$MVN_VERSION + fi + '''.stripIndent()) + 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' + } } }