Talend多个构建作业

时间:2017-02-12 11:17:11

标签: talend

我们正在使用开源Talend工作室,我们有超过50个工作岗位。 每个构建生成的zip文件都包含它的所有工件(.bat .sh context,jar文件)

有没有办法从工作室或命令行生成多个构建过程(Talend开源工具)

2 个答案:

答案 0 :(得分:2)

在“构建作业”窗口中,左侧有一个双箭头,

enter image description here

单击它,然后您将获得作业树,选择所有作业或您想要的内容,您将获得一个zip文件,其中包含您在单独文件夹中的所有作业。

答案 1 :(得分:1)

不是理想的解决方案,但您可以使用小脚本将整个zip拆分为单独的作业拉链:

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