|
49 | 49 | <echo message="Fetching from git remote ${deploy.remote}"/>
|
50 | 50 |
|
51 | 51 | <!-- Generate an md5 sum of the remote URL to use as remote name. -->
|
52 |
| - <exec command="echo ${deploy.remote} | openssl md5 | cut -d' ' -f 2" outputProperty="remoteName" checkreturn="true" level="info"/> |
53 |
| - <exec command="git remote add ${remoteName} ${deploy.remote}" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
| 52 | + <exec command="echo ${deploy.remote} | openssl md5 | cut -d' ' -f 2" outputProperty="remoteName" checkreturn="true" level="${blt.exec_level}"/> |
| 53 | + <exec command="git remote add ${remoteName} ${deploy.remote}" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
54 | 54 |
|
55 | 55 | <!-- @todo Only call this for the first remote. -->
|
56 | 56 | <phingcall target="deploy:remote:pull" />
|
57 | 57 | </target>
|
58 | 58 |
|
59 | 59 | <target name="deploy:remote:pull" description="Checks out deploy branch from upstream remote." hidden="true">
|
60 |
| - <exec command="git fetch ${remoteName} ${deploy.branch}" dir="${deploy.dir}" logoutput="true" level="info" passthru="true"/> |
| 60 | + <exec command="git fetch ${remoteName} ${deploy.branch}" dir="${deploy.dir}" logoutput="true" level="${blt.exec_level}" passthru="true"/> |
61 | 61 |
|
62 | 62 | <!-- Create the new branch, "[source-branch-name]-build". -->
|
63 | 63 | <!-- We intentionally use checkreturn="false" in case the branch already exists. `git checkout -B` does not seem to work as advertised -->
|
64 |
| - <exec command="git checkout -b ${deploy.branch}" dir="${deploy.dir}" logoutput="true" checkreturn="false" level="info" passthru="true"/> |
| 64 | + <exec command="git checkout -b ${deploy.branch}" dir="${deploy.dir}" logoutput="true" checkreturn="false" level="${blt.exec_level}" passthru="true"/> |
65 | 65 |
|
66 | 66 | <!-- Pull the latest updates (if available). -->
|
67 | 67 | <exec command="git merge ${remoteName}/${deploy.branch}" dir="${deploy.dir}" logoutput="true" passthru="true"/>
|
|
88 | 88 |
|
89 | 89 | <target name="deploy:commit" hidden="true">
|
90 | 90 | <!-- We make these commands quiet because they can cause the output to be so long that Travis CI stops logging. -->
|
91 |
| - <exec command="git add -A" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
92 |
| - <exec command="git commit -m '${deploy.commitMsg}' --quiet" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
| 91 | + <exec command="git add -A" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
| 92 | + <exec command="git commit -m '${deploy.commitMsg}' --quiet" dir="${deploy.dir}" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
93 | 93 | </target>
|
94 | 94 |
|
95 | 95 | <target name="deploy:composer:install" description="Downloads core and contrib to deploy folder." hidden="true">
|
|
104 | 104 | <include name="composer.lock"/>
|
105 | 105 | </fileset>
|
106 | 106 | </copy>
|
107 |
| - <exec dir="${deploy.dir}" command="export COMPOSER_EXIT_ON_PATCH_FAILURE=1; composer install --no-dev --prefer-dist --no-interaction --optimize-autoloader" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
| 107 | + <exec dir="${deploy.dir}" command="export COMPOSER_EXIT_ON_PATCH_FAILURE=1; composer install --no-dev --prefer-dist --no-interaction --optimize-autoloader" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
108 | 108 | </then>
|
109 | 109 | <else>
|
110 | 110 | <echo>Dependencies will not be built because deploy.build-dependencies is not enabled.</echo>
|
|
119 | 119 | <!-- @todo Support multisite. -->
|
120 | 120 | <chmod file="${docroot}/sites/default" mode="0777" />
|
121 | 121 |
|
122 |
| - <exec dir="${repo.root}" command="rsync -a --no-g --delete --delete-excluded --exclude-from=${deploy.exclude_file} ${repo.root}/ ${deploy.dir}/ --filter 'protect /.git/'" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
| 122 | + <exec dir="${repo.root}" command="rsync -a --no-g --delete --delete-excluded --exclude-from=${deploy.exclude_file} ${repo.root}/ ${deploy.dir}/ --filter 'protect /.git/'" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
123 | 123 |
|
124 | 124 | <!-- Use our own .gitignore -->
|
125 | 125 | <copy file="${deploy.gitignore_file}" tofile="${deploy.dir}/.gitignore" overwrite="true"/>
|
|
131 | 131 |
|
132 | 132 | <target name="deploy:prepare-dir" description="Delete the existing deploy directory and re-initialize as an empty git repository." hidden="true">
|
133 | 133 | <delete dir="${deploy.dir}" failonerror="false" quiet="true" />
|
134 |
| - <exec command="git init ${deploy.dir}" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
135 |
| - <exec dir="${deploy.dir}" command="git config --local core.excludesfile false" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
| 134 | + <exec command="git init ${deploy.dir}" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
| 135 | + <exec dir="${deploy.dir}" command="git config --local core.excludesfile false" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
136 | 136 | <echo>Global .gitignore file is being disabled for this repository to prevent unexpected behavior.</echo>
|
137 | 137 | </target>
|
138 | 138 |
|
|
142 | 142 |
|
143 | 143 | <target name="deploy:push-remote" description="Pushes to a git remote." hidden="true">
|
144 | 144 | <exec command="echo ${deploy.remote} | openssl md5 | cut -d' ' -f 2" outputProperty="remoteName"/>
|
145 |
| - <exec command="git push ${remoteName} ${deploy.branch}" dir="${deploy.dir}" outputProperty="deploy.push.output" logoutput="true" checkreturn="true" level="info"/> |
146 |
| - <exec command="export DEPLOY_UPTODATE=$(echo '${deploy.push.output}' | grep --quiet 'Everything up-to-date')" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
| 145 | + <exec command="git push ${remoteName} ${deploy.branch}" dir="${deploy.dir}" outputProperty="deploy.push.output" logoutput="true" checkreturn="true" level="${blt.exec_level}"/> |
| 146 | + <exec command="export DEPLOY_UPTODATE=$(echo '${deploy.push.output}' | grep --quiet 'Everything up-to-date')" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
147 | 147 | </target>
|
148 | 148 |
|
149 | 149 | <target name="deploy:sanitize" description="Removes sensitive files from the deploy docroot." hidden="true">
|
150 |
| - <exec command="find . -type d | grep '\.git' | xargs rm -rf" dir="${deploy.dir}/docroot" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
151 |
| - <exec command="find . -type d | grep '\.git' | xargs rm -rf" dir="${deploy.dir}/vendor" logoutput="true" checkreturn="true" level="info" passthru="true"/> |
| 150 | + <exec command="find . -type d | grep '\.git' | xargs rm -rf" dir="${deploy.dir}/docroot" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
| 151 | + <exec command="find . -type d | grep '\.git' | xargs rm -rf" dir="${deploy.dir}/vendor" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/> |
152 | 152 | <delete>
|
153 | 153 | <fileset dir="${deploy.dir}/docroot">
|
154 | 154 | <include name="core/*.txt"/>
|
|
0 commit comments