Skip to content
Newer
Older
100644 111 lines (94 sloc) 3.99 KB
b87dae8 @ericbarnes Added phing build file
ericbarnes authored
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="68KB" default="init-work-bench" basedir=".">
3
4 <property name="project.package" value="${phing.project.name}" override="true" />
5 <propertyprompt propertyName="revision" promptText="Enter the release to deploy: (example 1.0.0 'leave off the v')"/>
6 <!--<property name="revision" value="v0.0.1"/>-->
7 <property name="project.revision" value="${revision}" />
8 <property name="github.repos.dir" value="../../builds/68kb/v${project.revision}" override="true" />
9 <tstamp>
10 <format property="build.time" pattern="%m%d%Y" />
11 <format property="build.ug" pattern="%B %e, %Y" />
12 </tstamp>
13
14 <!-- deploy the applications files to the specific environment -->
15 <target name="deploy" depends="init-work-bench, clean-files"
16 description="update the application files in a specific environment">
17 <echo message="Finished deployment." />
18 </target>
19
20 <target name="init-work-bench"
21 depends="-init-ad-hoc-tasks, -clone-git-repos"
22 description="Initializes the hypothetical workbench">
23 <echo message="Finished release package." />
24 </target>
25
26 <target name="zip"
27 description="Zip up the files">
28 <zip destfile="../../builds/ice/iclassengine_v${project.revision}.zip">
29 <fileset dir="${github.repos.dir}">
30 <include name="**/**" />
31 </fileset>
32 </zip>
33 </target>
34
35 <target name="clean-files"
36 description="Removes files not included in the release.">
37 <delete file="${github.repos.dir}/68KB/README.md" />
38 <delete file="${github.repos.dir}/68KB/upload/unit_test.php" />
39 <delete file="${github.repos.dir}/68KB/upload/includes/application/cache" />
40 <delete file="${github.repos.dir}/68KB/.gitignore" />
41 <mkdir dir="${github.repos.dir}/68KB/upload/includes/application/cache" />
42 <touch file="${github.repos.dir}/68KB/upload/includes/application/cache/index.html" />
43
44 <delete dir="${github.repos.dir}/68KB/.git/" includeemptydirs="true" failonerror="true" />
45 <delete dir="${github.repos.dir}/68KB/do_not_upload/" includeemptydirs="true" failonerror="true" />
46
47 <!-- Set build date -->
48 <reflexive>
49 <fileset dir="${github.repos.dir}/iclassengine/">
50 <include name="upload/includes/iclassengine/controllers/setup.php" />
51 <include name="user_guide/index.html" />
52 </fileset>
53
54 <filterchain>
55 <replacetokens endtoken="##" begintoken="##">
56 <token key="BUILD" value="${build.time}"/>
57 <token key="UGBUILD" value="${build.ug}"/>
58 <token key="VERSION" value="${project.revision}"/>
59 </replacetokens>
60 </filterchain>
61 </reflexive>
62 </target>
63
64 <target name="-clean-git-repos"
65 description="Removes old repositories before initializing a new workbench">
66 <delete dir="${github.repos.dir}" includeemptydirs="true" failonerror="true" />
67 </target>
68
69 <target name="-init-ad-hoc-tasks"
70 description="Initializes the ad hoc task(s)">
71 <adhoc-task name="github-clone"><![CDATA[
72 class Github_Clone extends Task {
73
74 private $repository = null;
75 private $destDirectory = null;
76
77 function setRepos($repository) {
78 $this->repository = $repository;
79 }
80 function setDest($destDirectory) {
81 $this->destDirectory = $destDirectory;
82 }
83 function main() {
84 // Get project name from repos Uri
85 $projectName = str_replace('.git', '',
86 substr(strrchr($this->repository, '/'), 1));
87
88 $gitCommand = 'git clone ' . $this->repository . ' ' .
89 $this->destDirectory . '/' . $projectName;
90
91 exec(escapeshellcmd($gitCommand), $output, $return);
92
93 if ($return !== 0) {
94 throw new BuildException('Git clone failed');
95 }
96 $logMessage = 'Cloned Git repository ' . $this->repository .
97 ' into ' . $this->destDirectory . '/' . $projectName;
98 $this->log($logMessage);
99 }
100 }
101 ]]></adhoc-task>
102 <echo message="Initialized github-clone ad hoc task." />
103 </target>
104
105 <target name="-clone-git-repos" depends="-clean-git-repos"
106 description="Clones the needed Git repositories from GitHub">
107 <github-clone repos="git@github.com:68designs/68KB.git"
108 dest="${github.repos.dir}" />
109 </target>
110
111 </project>
Something went wrong with that request. Please try again.