This repository was archived by the owner on Aug 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
103 lines (89 loc) · 4.61 KB
/
build.xml
File metadata and controls
103 lines (89 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="UTF-8"?>
<project name="InterCEPT" default="env">
<!-- Locations of required binaries. -->
<property name="drush" value="${project.basedir}/bin/drush"/>
<property name="composer" value="/usr/local/bin/composer"/>
<property name="rsync" value="/usr/bin/rsync"/>
<property name="drupal" value="${project.basedir}/bin/drupal"/>
<!-- Installation and build-specific variables. -->
<property name="docroot" value="docroot"/>
<property name="profile" value="${docroot}/profiles/contrib/intercept_profile"/>
<property name="site" value="${docroot}/sites/default"/>
<property name="version" value="HEAD"/>
<!-- Database credentials. -->
<property name="db.type" value="mysql"/>
<property name="db.host" value="localhost"/>
<property name="db.user" value="root"/>
<property name="db.password" value="root"/>
<property name="db.database" value="intercept"/>
<property name="db.url" value="${db.type}://${db.user}:${db.password}@${db.host}/${db.database}"/>
<!-- Finds required binaries. -->
<target name="env">
<if>
<not>
<available file="${drush}" property="drush.exists"/>
</not>
<then>
<exec command="which drush" outputProperty="drush"/>
</then>
</if>
<exec command="which composer" outputProperty="composer"/>
<exec command="which rsync" outputProperty="rsync"/>
<echo message="Found Drush: ${drush}"/>
<echo message="Found Composer: ${composer}"/>
<echo message="Found rsync: ${rsync}"/>
</target>
<!-- Syncs the profile into the Drupal code base. -->
<target name="push" depends="env">
<!-- Create the destination if it doesn't exist. -->
<mkdir dir="${profile}"/>
<!-- rsync the profile, excluding developer flotsam. -->
<filesync destinationDir="${profile}" rsyncPath="${rsync}" sourceDir="." verbose="false"
exclude=".idea,bin,build.xml,.git,.gitignore,${docroot},node_modules,vendor" delete="true" />
</target>
<!-- Pull modified profile back to root. -->
<target name="pull" depends="env">
<filesync destinationDir="." rsyncPath="${rsync}" sourceDir="${profile}/" verbose="false"
exclude="modules/contrib"/>
</target>
<!-- Installs InterCEPT using drush. -->
<target name="install" depends="env">
<!-- Use passthru() when executing drush site-install so that we'll know if errors occur. -->
<exec command="${drush} si intercept_profile --account-pass='rcpl' --db-url=${db.url} -y" dir="${docroot}" passthru="true"/>
</target>
<!-- ReInstalls InterCEPT using drupal console. -->
<target name="reinstall" depends="env">
<!-- Use passthru() when executing drupal console site-install so that we'll know if errors occur. -->
<exec command="${drupal} site:install intercept_profile --no-interaction --force" dir="${docroot}" passthru="true"/>
<exec command="${drupal} cr all" dir="${docroot}" passthru="true"/>
<exec command="${drupal} ulu 1" dir="${docroot}" passthru="true"/>
</target>
<!-- Reinstall InterCEPT via drush (assumes settings.php) -->
<target name="db-reset" depends="env">
<exec command="${drush} si intercept_profile --account-pass='rcpl' -y" dir="${docroot}" passthru="true"/>
</target>
<!-- Destroys the installed code base. -->
<target name="destroy">
<if>
<available file="${site}" property="site.exists"/>
<then>
<chmod file="${site}" mode="0755"/>
</then>
</if>
<delete failonerror="true" includeemptydirs="true">
<fileset dir="." defaultexcludes="false">
<include name="bin/**"/>
<include name="${docroot}/**"/>
<include name="node_modules/**"/>
<include name="vendor/**"/>
</fileset>
</delete>
</target>
<target name="symlink-profile" depends="env">
<symlink target="../../../../composer.json" link="${profile}/composer.json" overwrite="TRUE" />
<symlink target="../../../../composer.lock" link="${profile}/composer.lock" overwrite="TRUE" />
<symlink target="../../../../intercept_profile.install" link="${profile}/intercept_profile.install" overwrite="TRUE" />
<symlink target="../../../../intercept_profile.profile" link="${profile}/intercept_profile.profile" overwrite="TRUE" />
<symlink target="../../../../intercept_profile.info.yml" link="${profile}/intercept_profile.info.yml" overwrite="TRUE" />
</target>
</project>