Advertisement
Guest User

phing_build

a guest
Jan 20th, 2015
627
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.59 KB | None | 0 0
  1. //** Содержание build.properties **//
  2.  
  3. # This dir must contain the local application
  4. build.dir=/path/to/backup
  5.  
  6. # Credentials for the database migrations
  7. ext.mysqldump=mysqldump
  8. db.host=localhost
  9. db.name=demo
  10. db.user=username
  11. db.pass=password
  12.  
  13.  
  14. //** Содержание build.xml **//
  15.  
  16. <?xml version="1.0"  encoding="UTF-8" ?>
  17.  
  18. <project name="demo" default="dev">
  19.     <tstamp>
  20.         <format property="datetime"  pattern="%Y-%m-%d %H-%M-%S" locale="ru_RU.UTF8" />
  21.     </tstamp>
  22.  
  23.     <!-- Load our configuration -->
  24.     <property file="./build.properties" />
  25.  
  26.     <target name="backup-db" description="Backup the database before upgrade.">
  27.         <!-- execute external command mysqldump to backup database -->
  28.         <exec command="${ext.mysqldump} --quick --host=${db.host} --password=${db.pass} --user=${db.user} ${db.name} | gzip > ${db.name}.sql.gz"
  29.               dir="./"
  30.               escape="false" />
  31.         <echo message="Database dumped ${db.name}.sql.gz" />
  32.     </target>
  33.  
  34.  
  35.     <target name="zip" depends="backup-db">
  36.         <echo>Archive backup ${build.dir}/${datetime} sport.tar.gz...</echo>
  37.         <tar destfile="${build.dir}/${datetime} project.tar.gz" compression="gzip">
  38.  
  39.     <!-- //** For yandex.disk **//  -->
  40.         <!--<tar destfile="/media/ya.dav/backup/project/${datetime} project.tar.gz" compression="gzip"> -->
  41.  
  42.             <fileset dir=".">
  43.                 <include name="*" />
  44.             </fileset>
  45.         </tar>
  46.         <echo>Delete dump sql: ${db.name}.sql.gz...</echo>
  47.         <delete file="${db.name}.sql.gz" />
  48.  
  49.     </target>
  50. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement