2016-10-31 3 views
0

にジョブ定義を作成するにはどうすれば非常に長いジョブ定義を持っています。読みやすいように複数の行に分ける方法があるのだろうかと思います。私は「\」で試してみましたか「\ n」はそれらはすべて、たとえば、雇用創出に失敗している:SpringXDは:seprateライン

xd:>job create --name myHttpJob --definition "httpJob \n 
      job create --name myHttpJob --definition "httpJob \n 
               ^
      Cannot have an unbalanced number of quotation marks 
    xd:>--listeners=disable" --deploy 
     Command '--listeners=disable" --deploy' not found (for assistance press TAB) 

    xd:>job create --name myHttpJob --definition "httpJob \ 
     job create --name myHttpJob --definition "httpJob \ 
              ^
      Ran out of input in escape sequence 
    xd:>--listeners=disable" --deploy 
     Command '--listeners=disable" --deploy' not found (for assistance press TAB) 

答えて

1

うまくいけば、これはまだそこに誰かに役立ちます。私はあなたが現在XD-シェルのバージョンが、私は何を私は全体のプロセスを実行するためにシェルスクリプトを使って、全体のプロセスを外部化されて複数行にコマンドを分離することができるでしょうとは思いません。これは、同じコマンドまたは類似のコマンドを何度も実行し、コマンドをパラメータ化できる必要がある場合に便利です。以下は、あなたのシェルスクリプトは、(のは、ファイルmyxdshellfile.shを呼びましょう)が含まれますもののサンプルです。私はすべての私のカスタムモジュールのアップロード/展開/定義とストリームにも同様のスクリプトを用意しています。うまく設定したら、別の環境にデプロイするためにパラメータ化し、環境を入力argとして渡すことができます。

echo -n -e " \ 
job create --name ${module}_${version} \ 
--definition \"${moduleDefinition} \ 
--restartable=false \ 
--dateFormat=yyyy-MM-dd \ 
--makeUnique=true \ 
--partitionResultsTimeout=7200000 \ 
\ 
--jdbcDriver=com.mysql.jdbc.Driver \ 
--jdbcUser=${user} \ 
--jdbcPassword=${pwd} \ 
--jdbcUrl=jdbc:mysql://${dbhost} \ 
\ 
--version=${version} \ 
\ 
\" 
" > "$cmdfile" 

#write string to file 
echo -e -n .${shellpath}/shell/bin/xd-shell --cmdfile ${cmdfile} 

#see what's in the file 
cat ${cmdfile} 

#execute spring-xd shell 
bash ${shellpath}/shell/bin/xd-shell --cmdfile ${cmdfile} 
+0

非常に役に立った..ありがとうございます! – jlp

関連する問題