3

We are using open source Talend studio and we have more then 50 jobs. Each build generate zip file contains all it's artifacts ( .bat .sh context, jar files)

Is there a way to generate multiple build process from the studio or command line ( Talend open source tool )

Arnon Rodman
  • 511
  • 2
  • 6
  • 21

2 Answers2

2

In the "build job" window, there is a double arrow in the left,

enter image description here

Click on it, and you get the job tree, select all jobs or what you want, and you will get a single zip file containing all your jobs each one in a separate folder.

54l3d
  • 3,913
  • 4
  • 32
  • 58
  • I understood that Arnon wants separate zip files – kdev Feb 13 '17 at 10:44
  • Thanks that will solve the first part , one more thing is it possible to add the java files to Git and build it from Jenkinse.( i found some question with the same problem but no solution) – Arnon Rodman Feb 13 '17 at 12:41
  • @ArnonRodman it solve the written question, you can edit your post and add other parts. So after the building you can create a script that push into Git, for jenkins i never worked on it. – 54l3d Feb 13 '17 at 12:53
  • @ArnonRodman same for me, the only answer is the command line tool available in enterprise only. I started to think about developing this tool based on the sources of Talend Open Studio, but not sure if it is worth it. – kdev Feb 13 '17 at 13:04
1

Not an ideal solution but you can use a small script to split the whole zip into separate job zips:

ZIP=test.zip # path to your all-in-one zip file
ROOT=$(basename $ZIP .zip)
DEST=./dest
rm -rf $DEST # be careful with this one!
mkdir -p $DEST
unzip $ZIP
find $ROOT -mindepth 1 -maxdepth 1 -type d ! -name lib|while read JOBPATH
do
        JOB=$(basename $JOBPATH)
        echo "job: $JOB"
        DJOB="$DEST/$JOB"
        mkdir -p "$DJOB"
        cp -R "$JOBPATH" "$DJOB/$JOB"
        cp $ROOT/jobInfo.properties $DJOB # here you should replace job=<proper job name> and jobId, but not sure you really need it
        mkdir -p "$DJOB/lib"
        RUNFILE="${JOBPATH}/${JOB}_run.sh"
        LIBS=$(grep "^java" "$RUNFILE"|cut -d' ' -f 5)
        IFS=':' read -ra ALIB <<< "$LIBS"
        for LIB in "${ALIB[@]}"; do
                if [ "$LIB" = "." -o "$LIB" = "\$ROOT_PATH" ]; then continue; fi
                echo "$LIB"
        done|grep "\$ROOT_PATH/../lib"|cut -b 19-|while read DEP
        do
                cp "$ROOT/lib/$DEP" "$DJOB/lib/"
        done
        (cd $DJOB ; zip -r -m ../$JOB.zip .)
        rmdir $DJOB
done
kdev
  • 705
  • 7
  • 11