dongyo1818 2012-12-21 00:28
浏览 29

如何根据当前版本运行Phing目标?

How can I create a Phing build script that will handle deployments, and migrate a project from it's current version to the latest version?

Assuming that I have broken my deployment down into incremental version updates. Let's say my live server is running version 1, and I want to deploy version 3

The build script should update version 1 to version 2 and then from version 2 to version 3.

So the build script could look something like this.

<project name="deploy">
      <target name="version1">
           <if_version_is_0>
               ..do update
           </if_version_is_0>
      </target>
      <target name="version2" depends="version1">
           <if_version_is_1>
               ..do update
           </if_version_is_1>
      </target>
      <target name="version3" depends="version2">
           <if_version_is_2>
               ..do update
           </if_version_is_2>
      </target>

      <target name="build" depends="version3"/>
</project>

My problem is with the line

<if_version_is_##>

How can I make a condition based upon the current version of the project?

I did find the VersionTask in the documentation, but it handles version number increasing. I need to read the current version into a property or something like that. How can that be done?

  • 写回答

1条回答 默认 最新

  • doubi4617 2012-12-21 00:39
    关注

    I think this feature might do what I want.

    http://www.phing.info/docs/guide/stable/chapters/appendixes/AppendixB-CoreTasks.html#LoadFileTask

    <loadfile property="version" file="version.txt"/>
    

    That will let me get the current version as a property, which I can then use as a condition to perform the update.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题