]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Update to jenkins file 67/2067/1
authorMiro Richard Eklund <miro.eklund@semantum.fi>
Fri, 31 Aug 2018 09:47:47 +0000 (12:47 +0300)
committerMiro Richard Eklund <miro.eklund@semantum.fi>
Fri, 31 Aug 2018 09:47:47 +0000 (12:47 +0300)
gitlab #28

Change-Id: I9571f40625e737935e55304761f9080291acfbdf

releng/JenkinsFiles/Jenkinsfile-sysdyn-simupedia-om

index fb6f2c4cbf4e61696aafc83b8bbe6eb39d9a3414..29c5c18ef9904b9771986b646959b6d99f395fce 100644 (file)
@@ -1,77 +1,66 @@
 pipeline {
-       node('master') {
-           agent none 
-               stages  {
-               stage ('Publish product to web') {
-                       sh """
-function director_install() {
-        REPO=$1
-        IUs=$2
-        TAG=$3
-        DEST=$4
-        /opt/eclipse/eclipse -noSplash \
-                -application org.eclipse.equinox.p2.director \
-                -repository ${REPO} \
-                -installIU ${IUs} \
-                -tag ${TAG} \
-                -destination ${DEST} \
-                -profile DefaultProfile
-}
+    node('master') {
+        agent none 
+        stages  {
+            stage ('Build and possible publish product to web') {
+                bash '''#!/bin/bash
+                    PKG=Simantics-Desktop-win32.win32.x86_64
+                    TGT=Simantics-Sysdyn-Simupedia-OM-win32.win32.x86_64
 
-function repackage() {
-        BRANCH=$1
-        PKG=$2
-        TGT=$3
+                    echo "Download current desktop product"
+                    wget -nv http://www.simantics.org/download/${BRANCH}/${PKG}.zip
 
-        echo "Download current desktop product"
-        wget -nv http://www.simantics.org/download/${BRANCH}/${PKG}.zip
+                    echo "Unzip Desktop product"
+                    unzip -q -d ${PKG} ${PKG}.zip
 
-        echo "Unzip Desktop product"
-        unzip -q -d ${PKG} ${PKG}.zip
+                    echo "Install sysdyn feature into unzipped product"
+                    /opt/eclipse/eclipse -noSplash \
+                            -application org.eclipse.equinox.p2.director \
+                            -repository http://www.simantics.org/download/${BRANCH}/sysdyn/p2.site/ \
+                            -installIU fi.semantum.simupedia.documentserver.feature \
+                            -tag AddSysdyn \
+                            -destination ${PKG} \
+                            -profile DefaultProfile
 
-        echo "Install sysdyn feature into unzipped product"
-        director_install \
-                http://www.simantics.org/download/${BRANCH}/sysdyn/p2.site/ \
-                org.simantics.sysdyn.internal.p2.feature.group \
-                AddSysdyn \
-                ${PKG}
-
-        echo "Install simupedia documentserver feature into unzipped product"
-        director_install \
-               https://www.simantics.org/update/simupedia/${BRANCH}/p2.site/ \
-               fi.semantum.simupedia.documentserver.feature \
-               AddSimupediaSysdyn \
-               ${PKG}
+                    echo "Install simupedia documentserver feature into unzipped product"
+                    /opt/eclipse/eclipse -noSplash \
+                            -application org.eclipse.equinox.p2.director \
+                            -repository https://www.simantics.org/update/simupedia/${BRANCH}/p2.site/ \
+                            -installIU fi.semantum.simupedia.documentserver.feature \
+                            -tag AddSimupediaSysdyn \
+                            -destination ${PKG} \
+                            -profile DefaultProfile
         
-        echo "Install simupedia documentserver feature into unzipped product"
-        director_install \
-               https://www.simantics.org/update/simupedia-sysdyn/${BRANCH}/p2.site/ \
-               fi.semantum.simupedia.simulation.sysdyn.feature \
-               AddSimupediaSimulationSysdyn \
-               ${PKG}
-
-        echo "Install open modelica"
-        director_install \
-               http://www.simantics.org/download/master/openmodelica/p2.site/ \
-               org.simantics.om.feature \
-               AddOpenModelica \
-               ${PKG}
-
-        echo "Re-package as SimanticsSysdynSimupediaOM.product"
-        mv -v ${PKG} ${TGT}
-        7z a -tzip ${TGT}.zip ${TGT} > /dev/null
-        rm -rf ${PKG}.zip ${TGT}
-}
+                    echo "Install simupedia documentserver feature into unzipped product"
+                    /opt/eclipse/eclipse -noSplash \
+                            -application org.eclipse.equinox.p2.director \
+                            -repository https://www.simantics.org/update/simupedia-sysdyn/${BRANCH}/p2.site/ \
+                            -installIU fi.semantum.simupedia.simulation.sysdyn.feature \
+                            -tag AddSimupediaSimulationSysdyn} \
+                            -destination ${PKG} \
+                            -profile DefaultProfile
 
-repackage ${GERRIT_REFNAME} Simantics-Desktop-win32.win32.x86 Simantics-Sysdyn-Simupedia-OM-win32.win32.x86
-repackage ${GERRIT_REFNAME} Simantics-Desktop-win32.win32.x86_64 Simantics-Sysdyn-Simupedia-OM-win32.win32.x86_64
+                    echo "Install open modelica"
+                    /opt/eclipse/eclipse -noSplash \
+                            -application org.eclipse.equinox.p2.director \
+                            -repository http://www.simantics.org/download/master/openmodelica/p2.site/ \
+                            -installIU org.simantics.om.feature \
+                            -tag AddOpenModelica \
+                            -destination ${PKG} \
+                            -profile DefaultProfile
 
-PRODUCT_PUBLISH_DIR=/var/www/http-www.simantics.org/download/${GERRIT_REFNAME}/sysdyn/products
+                    echo "Re-package as SimanticsSysdynSimupediaOM.product"
+                    mv -v ${PKG} ${TGT}
+                    7z a -tzip ${TGT}.zip ${TGT} > /dev/null
+                    rm -rf ${PKG}.zip ${TGT}
 
-echo "Publishing product archives at: ${PRODUCT_PUBLISH_DIR}"
-mkdir -p ${PRODUCT_PUBLISH_DIR}
-rsync --stats --verbose --recursive --delete ${WORKSPACE}/*.zip ${PRODUCT_PUBLISH_DIR}
-"""
-           }
-       }
+                    if [ -n "${PUBLISH_PRODUCTS}" ]; then
+                        PRODUCT_PUBLISH_DIR=/var/www/http-www.simantics.org/download/${BRANCH}/sysdyn/products
+                        echo "Publishing product archives at: ${PRODUCT_PUBLISH_DIR}"
+                        mkdir -p ${PRODUCT_PUBLISH_DIR}
+                        rsync --stats --verbose --recursive --delete ${WORKSPACE}/*.zip ${PRODUCT_PUBLISH_DIR}
+                    fi
+                '''
+        }
+    }
 }
\ No newline at end of file