Итак, вот в чем дело:мерзавец тянуть медленно, когда используется в скрипте
[email protected]:xx (master)$ ant -v update
Apache Ant version 1.6.5 compiled on January 6 2007
Buildfile: build.xml
Detected Java version: 1.5 in: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85.x86_64/jre
Detected OS: Linux
parsing buildfile /var/www/xx/xx/xx/build.xml with URI = file:///var/www/xx/xx/xx/build.xml
Project base dir set to: /var/www/xx/xx/xx
Build sequence for target(s) `update' is [git-pull, update]
Complete build sequence is [git-pull, update, composer-master, master_check, fetch_master, lint, api_check, create_api, prune_api, fetch_api, use_api, create_master, prune_master, use_master, shared_check, create_shared, prune_shared, fetch_shared, use_shared, webservices_check, create_webservices, prune_webservices, fetch_webservices, use_webservices, use_dependencies, clean, prepare, basedir, composer-api, composer-portal, copy_api_ini, copy_portal_ini, phpdoc, build_nocq, phpunit, build_and_test, code-coverage, phpcpd, commit, pdepend, full_build, phpcs, pdepend-w-charts, ]
git-pull:
[echo] git pull
[exec] Current OS is Linux
[exec] Executing 'git' with arguments:
[exec] 'pull'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
Username for 'https://git.xx.net': matthijs
Password for 'https://[email protected]':
[exec] Already up-to-date.
update:
BUILD SUCCESSFUL
Total time: 32 seconds
Как вы можете видеть, что это занимает 30+ секунд.
The (связанные) вещи из моего build.xml файла:
<macrodef name = "git">
<attribute name = "command" />
<!--<attribute name = "options" default=""/>-->
<attribute name = "dir" default = "" />
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}">
<arg value = "@{command}" />
<!--<arg value = "@{options}" />-->
<args/>
</exec>
</sequential>
</macrodef>
<target name="git-pull" description="Pull the current git branch">
<git command="pull" dir="." />
</target>
<target name="update" depends="git-pull" />
(Удалены все не соответствующий код)
Когда я исполняю git pull
через CLI это намного быстрее:
[email protected]:xx (master)$ time git pull
Username for 'https://git.xx.net': matthijs
Password for 'https://[email protected]':
Already up-to-date.
real 0m2.997s
user 0m0.081s
sys 0m0.083s
Почему «прямой» способ намного быстрее? Имеет ли муравей больше вещей? Разве это не знает, когда git «сделано»?
Примечание без пароля (кешированный паролем) это быстро. Да, я знаю, что можно использовать ключи ssh и т. Д., Но это не нужно.
редактировать: Действительно странно, это с паролем кэшированием (это было быстро, всего несколько минут назад)
[email protected]:xx (master)$ ant update
Buildfile: build.xml
git-pull:
[echo] git pull
[exec] Already up-to-date.
update:
BUILD SUCCESSFUL
Total time: 1 minute 13 seconds