GROOVYスクリプトで次のように実装しようとしていますが、エラーが発生しました: HTMLファイルの内容を配列で読み込み、grep
の配列を読み込みます。Groovy:配列内のファイルの内容を読み込み、何かgrepを受け取ります
def file1 = new File("/path/to/the/file/xyz.html");
def lines = file1.readLines()
if ((-e "/path/to/the/file/xyz.html") and (!(grep /jira.bugtracker.com/, lines))
{
println (" the changes are present\n");
exit 0;
}
else
{
println (" the changes are not present\n");
exit 1;
}
コードを確認し、正しい方法を提案してください。
どのようなエラーが表示されますか?これはJenkinsfileの文脈でですか?あなたはそれを投稿できますか? – burnettk