0

我正在尝试修改基于 ant on solaris 的工作脚本。它曾经使用 ant copy、ant makedir 和 svn-checkout 从 svn url 运行结帐。

但由于一次我只能为一个分支运行签出,我通过动态提供属性来修改脚本,例如,ant copy -DProperty=build_$2.properties,其中 $2 是分支名称。与之前我们使用的 build.properties 文件不同,它几乎是硬编码的。

在 shell 脚本中进行了这些修改之后,我确实更新了被调用的 build.xml,使用 .

现在在测试不同分支甚至一个分支的并行检出时,新脚本失败并出现以下错误。

***[taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.
makedir:
[echo] Creating new Dir in tags directory with name ... ${TAG}
BUILD FAILED
/opt/app/d1wap1a1/devSrcRepository/scripts/SVN_DSSHTML/build.xml:130: java.net.MalformedURLException: Invalid svn url: ${createTagDIR}***

请注意,之前一切都很好,我想这不是 ant 库问题,因为错误可能表明,因为没有应用修改,脚本可以完美运行。

在提供正确的分支和发布值时,脚本会执行此操作,

cat dirname_$2 |grep -v "#" | grep -i $1 >> temp_dsshtml 
numdir=cat temp_dsshtml |wc -l 
sed -e 's%BRCH%'${branch}'%g' build_tag_number.conf > build.properties 
ant copy -DProperty=build_$2.properties

现在调用 ant 副本,根据 build.xml 取决于 makedir 目标,如下所示 -

   <target name="makedir" description="To create a new Directory in SVN Repository at specified URL ">  
<echo message="Creating new Dir in tags directory with name ... ${TAG}"/> 
<svn username="${SVN_USER}" password="${SVN_PWD}">  
<mkdir url="${createTagDIR}" message="Created new tag with name ${TAG}"/> 
</svn>  <echo message="Created a new DIR in the URL ... ${createTagDIR}"/> 
 </target>

createTagDIR值取自build_tag_number.conf ,其中包含您可能需要的以下相关部分。

URL=svn://scm.it.att.com:13388/branch_name  
BURL=${URL}/branches 
TURL=${URL}/tags  
svnProject=${TURL}/${TAG}/DIRC  
BRANCH=BRCH 
DIR_CHECKOUT=DIRC  
createTagDIR=${TURL}/${TAG}

现在,在脚本运行之前,从已取消注释的行中选择 TAG 值。见下文。

标签=tb1309xxxx #标签=tb1311xxx

我想,它有所有细节,现在我的观察是因为makedir目标无法在 svn 位置创建新的标签目录。它必须无法获取createTagDIR=${TURL}/${TAG}的值,其中TURL=${URL}/tags,并且 URL 定义为URL=svn://scm.it.att.com: build_tag_number.conf 中的13388/dss

4

0 回答 0