Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added basic git support

  • Loading branch information...
commit 55831271ede38254261bd7db211ca70aa9edc209 1 parent e2367ea
@wycks authored
Showing with 81 additions and 33 deletions.
  1. +29 −15 README.md
  2. +21 −15 build.properties
  3. +31 −3 build.xml
View
44 README.md
@@ -13,7 +13,7 @@ WordPress build script using [Phing](http://www.phing.info/).
## Features
-**Installation Automation:**
+**Installation**
- Creation of a new database (optional)
- Downloads and installs WordPress (latest stable)
@@ -24,7 +24,8 @@ WordPress build script using [Phing](http://www.phing.info/).
**Build Automation:**
-- PHP CodeSniffer and Reporting
+- SQL Export
+- PHP CodeSniffer and Copy/Paste Detector
- PHP Documentor 2
- FTP
- Minify js
@@ -42,19 +43,33 @@ Open build.properties and fill it out and also read the comments:)
Main Command options
-- `"phing wp-install"` Creates a database and WordPress
-- `"phing wp-install-only"` Creates just WordPress (will not create the database)
-- `"phing wp-clean-all"` Deletes directory and database
-- `"phing wp-db-dump"` Export DB *.sql
-- `"phing wp-reports"` Run CodeSniffer, PHP Mess Detector, Copy-Paste Detector
-- `"phing wp-doc"` Runs PHP Documentor 2
-- `"phing help"` Command line options
-
+- `"phing wp-install"` Creates a database and WordPress
+- `"phing wp-install-only"` Creates just WordPress (will not create the database)
+- `"phing wp-clean-all"` Deletes directory and database
+- `"phing wp-reports"` Run CodeSniffer, PHP Mess Detector, Copy-Paste Detector
+- `"phing wp-doc"` Runs PHP Documentor 2
+- `"phing wp-run"` Runs custom WP friendly script
+- `"phing help"` Command line options
-Lesser Commands
+Move Commands
- `"phing wp-ftp"` FTP upload
-- `"phing wp-run"` Runs custom WP friendly script
+- `"phing wp-db-dump"` Export DB *.sql
+- `"phing wp-direct-move"` ..not tested yet
+- `"phing wp-ssh-move"` ..not tested yet
+
+Git Commands
+
+- `"phing wp-git-init"` Initialize a git repo
+- `"phing wp-git-commit"` Prompts for a commit msg before commit
+- `"phing wp-git-clone"`
+- `"phing wp-git-pull"`
+- `"phing wp-git-push"`
+- `"phing wp-git-branch"`
+
+
+Other Commands
+
- `"phing wp-min-js"` Minify JS
- `"phing wp-zip"` Creates a zip from directory
- `"phing wp-zip-file"` Creates a zip from file
@@ -67,7 +82,7 @@ Lesser Commands
- `"phing wp-mess"` PHP Mess Detector
-Commands are chainable , for example `"phing wp-install wp-gzip wp-ftp"`
+Commands are chainable , for example `"phing wp-install wp-git-init"`
##Advanced Instructions
@@ -119,11 +134,10 @@ PHP 5.2 + & Phing.
##Todo
-- Database dump + whole site migration
+- Remote Database dump + whole site migration
- Maybe Add git & svn support
- Add backups via Rsync and Amazon
- CSS minify (yui-compress) requires java :( switch js to yui as well since php one is depreciated.
-- Staging and continuous integration?
##Install
View
36 build.properties
@@ -6,7 +6,11 @@
#Full path directory where you want to install WordPress
#Required
-build.dir.wp=D:/Sites/Bar
+build.dir.wp=D:\Sites\wordpress-core-trac\WordPress
+
+#Working directory
+# If you want to work on a different directory than above (for git, minify, repots, etc)
+build.dir.work=${build.dir.wp}
#The database name you want to create or are using.
#Required
@@ -74,7 +78,7 @@ build.wp.db.dump.send=${build.wp.db.dump.folder}\${build.wp.db.dump.name}-${DSTA
# FTP
#
-ftp.source=${build.dir.wp}
+ftp.source=${build.dir.work}
ftp.host=ftp.example.com
ftp.port=21
ftp.username=username
@@ -82,14 +86,22 @@ ftp.password=password
ftp.dir=/public_html/example
#---------------------------------------------------------------------------
+# Git Stuff
+#---------------------------------------------------------------------------
+build.git.init=${build.dir.work}
+build.git.clone=
+build.git.pull=
+build.git.push=
+build.git.branch=
+
+#---------------------------------------------------------------------------
# WordPress Report Stuff
#---------------------------------------------------------------------------
-#----------------
#Base for all reports for some reason it's named sniff
#Change this to your theme/plugin or whatever you want to run report on
#
-build.wp.sniff.dir=${build.dir.wp}\wp-content\themes\twentythirteen
+build.wp.sniff.dir=${build.dir.work}\wp-content\themes\twentythirteen
# change output dir if needed
build.wp.sniff.dir.output=${build.wp.sniff.dir}\reports
@@ -100,8 +112,6 @@ build.wp.sniff.input =${build.wp.sniff.dir}
build.wp.sniff.output=${build.wp.sniff.dir.output}
build.wp.sniff.output.xml=${build.wp.sniff.output}\${build.wp.sniff.xml.file}
build.wp.sniff.output.temp=${build.wp.sniff.dir.output.temp}
-#----------------
-
#----------------
# PHP Documentor 2 - http://www.phpdoc.org/
@@ -144,33 +154,29 @@ build.wp.sniff.style=.\assets\CodeSniffer\PHP-Codesniffer.xsl
# WordPress Misc Stuff
#---------------------------------------------------------------------------
-#---------------
# Tarballs
#
# Name - this is set to the blog title + time stamp by default
build.wp.tarball.name = ${build.wp.title.ref}-${DSTAMP}
#Tarball dir you want to package , this is set to the build dir by default
-build.wp.tarball.location = ${build.dir.wp}
+build.wp.tarball.location = ${build.dir.work}
#Tarball file you want to package, set to DB .sql dump by default
build.wp.tarball.file = ${build.wp.db.dump.send}
#Where are we sending the tarball? this is set to the build dir by default
-build.wp.tarball.send = ${build.dir.wp}
-#--------------
+build.wp.tarball.send = ${build.dir.work}
+
#--------------
# JsMin
#
# Minifying js is build into phing
#directory with your js files in it
-build.wp.jsmin.dir = ${build.dir.wp}\wp-content\themes\twentyeleven\js
+build.wp.jsmin.dir = ${build.dir.work}\wp-content\themes\twentyeleven\js
#output will go in here with -min suffix
-build.wp.jsm.output = ${build.dir.wp}\wp-content\themes\twentyeleven\js\min
-#--------------
-
+build.wp.jsm.output = ${build.dir.work}\wp-content\themes\twentyeleven\js\min
#--------------
#Timestamps
#
build.dt.buildformat = %a, %d %b %Y, %H:%M
build.dt.fileformat = %Y-%m-%d-%H-%M
-#--------------
View
34 build.xml
@@ -60,7 +60,7 @@
TODO: This is not complete
************************************************************** -->
- <target name="wp-sql-direct-move">
+ <target name="wp-direct-move">
<!-- create db on other host -->
<exec command="mysqladmin -h 'other_hostname' create db_name" />
<exec command="mysqldump db_name | mysql -h 'other_hostname' db_name" />
@@ -72,7 +72,7 @@
TODO: This is not complete
************************************************************** -->
- <target name="wp-sql-ssh-move">
+ <target name="wp-ssh-move">
<!-- move the db + files -->
<scp username="john"
password="smith"
@@ -446,7 +446,6 @@
</zip>
</target>
- <!-- ---- -->
<target name="wp-gzip">
@@ -572,6 +571,35 @@ TODO Converting xml to html using /assets/pmd-html.xslt is broken
</target>
+<!-- Git Stuff
+#
+************************************************************* -->
+<target name="wp-git-init">
+ <exec command="git init ${build.git.init}" />
+</target>
+
+<target name="wp-git-commit">
+ <input propertyName="commit.entered" defaultValue="default">Enter a commit msg please:</input>
+ <exec command="git commit -m ${commit.entered}" />
+ <echo msg="yes! git commit is ${commit.entered}" />
+</target>
+
+<target name="wp-git-clone">
+ <exec command="git clone ${build.git.clone}" />
+</target>
+
+<target name="wp-git-push">
+ <exec command="git push ${build.git.push}" />
+</target>
+
+<target name="wp-git-pull">
+ <exec command="git pull ${build.git.pull}" />
+</target>
+
+<target name="wp-git-branch">
+ <exec command="git branch ${build.git.branch}" />
+</target>
+
<!-- Our main installer * This will install the DB and WordPress
************************************************************* -->
Please sign in to comment.
Something went wrong with that request. Please try again.