我正在尝试使用Phing来部署我的项目。Checkout from SVN
和脚本工作得很好,Running Composer
但我的数据库的迁移却没有。这是错误消息:
目标“迁移”的执行失败,原因如下:任务以代码 2 退出
sh:无法打开 build/scripts/deploy-.sql:没有这样的文件
似乎 delta 文件不是由 Phing 生成的。
我的Migration
脚本如下所示:
<target name="migration" description="Datenbankmigration">
<property file="${phing.dir}/includes/build.properties"/>
<propertyprompt propertyName="db.name" defaultValue="${db.name}" promptText="Datenbankname angeben falls nicht der Defaultwert genutzt werden soll. Default:" />
<propertyprompt propertyName="db.username" defaultValue="${db.username}" promptText="Datenbankbenutzernamen angeben falls nicht der Defaultwert genutzt werden soll. Default:" />
<propertyprompt propertyName="db.password" defaultValue="" promptText="Datenbankpasswort angeben falls nicht der Defaultwert genutzt werden soll. Default:" />
<propertyprompt propertyName="db.host" defaultValue="${db.host}" promptText="Host angeben falls nicht der Defaultwert genutzt werden soll. Default:" />
<!-- load the dbdeploy task -->
<taskdef name="dbdeploy" classname="phing.tasks.ext.dbdeploy.DbDeployTask" />
<!-- these two filenames will contain the generated SQL to do the deploy and roll it back -->
<property name="build.dbdeploy.deployfile" value="${phing.dir}build/scripts/deploy-${DSTAMP}${TSTAMP}.sql" />
<property name="build.dbdeploy.undofile" value="${build.dir}build/scripts/undo-${DSTAMP}${TSTAMP}.sql" />
<!-- create the changelog Table -->
<pdosqlexec url="mysql:host=${db.host};dbname=${db.name}" userid="${db.username}" password="${db.password}">
<transaction src="build/sql/changelog.sql"/>
</pdosqlexec>
<!-- generate the deployment scripts -->
<dbdeploy
url="mysql:host=${db.host};dbname=${db.name}"
userid="${db.username}"
password="${db.password}"
dir="${phing.dir}/sql/delta"
outputfile="${build.dbdeploy.deployfile}"
undooutputfile="${build.dbdeploy.undofile}" />
<!-- execute the SQL - Use mysql command line to avoid trouble with large
files or many statements and PDO -->
<exec
command="mysql -h${db.host} -u${db.username} -p${db.password} ${db.name} < ${build.dbdeploy.deployfile}"
dir="${phing.dir}"
checkreturn="true"
output="${phing.dir}/cache/deploy-${DSTAMP}${TSTAMP}.log"
error="${phing.dir}/cache/deploy-error-${DSTAMP}${TSTAMP}.log"
/>
<echo msg="Datenbank erfolgreich angelegt"/>
</target>
有谁知道为什么?